diff options
author | Håkon Hallingstad <hakon@yahoo-inc.com> | 2016-09-27 16:45:36 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@yahoo-inc.com> | 2016-09-27 16:45:36 +0200 |
commit | 504399574b97cf6bb095a640eeb0ddaf19f096c7 (patch) | |
tree | 681cd2c99858748243ea94d09fef7f7cb9cdb03e /container-disc | |
parent | 223fcaedfa6c3ae6df6ae4136690534fac6e98da (diff) |
Set 4GB as the effective total memory size when starting jdisc containers
Diffstat (limited to 'container-disc')
-rwxr-xr-x | container-disc/src/main/sh/vespa-start-container-daemon.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/container-disc/src/main/sh/vespa-start-container-daemon.sh b/container-disc/src/main/sh/vespa-start-container-daemon.sh index 3afefd6f86d..e48eb82fd9a 100755 --- a/container-disc/src/main/sh/vespa-start-container-daemon.sh +++ b/container-disc/src/main/sh/vespa-start-container-daemon.sh @@ -65,8 +65,13 @@ configure_memory() { consider_fallback jvm_baseMaxDirectMemorySize 75 consider_fallback jvm_directMemorySizeCache 0 - if (( jvm_heapSizeAsPercentageOfPhysicalMemory > 0 && jvm_heapSizeAsPercentageOfPhysicalMemory < 100 )); then - available=`free -m | grep Mem | tr -s ' ' | cut -f2 -d' '` + if (( jvm_heapSizeAsPercentageOfPhysicalMemory > 0 && jvm_heapSizeAsPercentageOfPhysicalMemory > 0 )) || test "$TOTAL_MEMORY_MB" != ""; then + if test "$TOTAL_MEMORY_MB" != ""; then + available="$TOTAL_MEMORY_MB" + else + available=`free -m | grep Mem | tr -s ' ' | cut -f2 -d' '` + fi + jvm_heapsize=$[available * jvm_heapSizeAsPercentageOfPhysicalMemory / 100] if (( jvm_heapsize < 1024 )); then jvm_heapsize=1024 |