mirror of https://github.com/samply/bridgehead.git
refactor: calculate memory using free
Co-authored-by: Tobias Kussel <TKussel@users.noreply.github.com>
This commit is contained in:
parent
7d07c0623d
commit
b5ef856f12
|
@ -159,8 +159,7 @@ setHostname() {
|
||||||
# the memory cap will be applied to both the java heap size and db clock cache
|
# the memory cap will be applied to both the java heap size and db clock cache
|
||||||
setBlazeMemoryCap() {
|
setBlazeMemoryCap() {
|
||||||
if [ -z "$BLAZE_MEMORY_CAP" ]; then
|
if [ -z "$BLAZE_MEMORY_CAP" ]; then
|
||||||
system_memory=$(grep MemTotal /proc/meminfo | grep -Po '\d+');
|
system_memory_in_mb=$(free -m | grep 'Mem:' | awk '{print $2}');
|
||||||
system_memory_in_mb=$(("$system_memory"/1024));
|
|
||||||
export BLAZE_MEMORY_CAP=$(("$system_memory_in_mb"/4));
|
export BLAZE_MEMORY_CAP=$(("$system_memory_in_mb"/4));
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue