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
|
||||
setBlazeMemoryCap() {
|
||||
if [ -z "$BLAZE_MEMORY_CAP" ]; then
|
||||
system_memory=$(grep MemTotal /proc/meminfo | grep -Po '\d+');
|
||||
system_memory_in_mb=$(("$system_memory"/1024));
|
||||
system_memory_in_mb=$(free -m | grep 'Mem:' | awk '{print $2}');
|
||||
export BLAZE_MEMORY_CAP=$(("$system_memory_in_mb"/4));
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue