summaryrefslogtreecommitdiffstats
path: root/container-disc/src
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahoo-inc.com>2016-09-28 09:03:10 +0200
committerHåkon Hallingstad <hakon@yahoo-inc.com>2016-09-28 09:03:10 +0200
commita236f44579644e2c03cd36ed8dca453059931568 (patch)
tree1bc0194754d5d7bdcdae9542f8fafddafef9b027 /container-disc/src
parent072501a96473c27538ccb4b846c7df60611711d3 (diff)
Handle absent heapSizeAsPercentageOfPhysicalMemory
Diffstat (limited to 'container-disc/src')
-rwxr-xr-xcontainer-disc/src/main/sh/vespa-start-container-daemon.sh9
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 6eadb71d698..0c1f9da4739 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 )) || test "$TOTAL_MEMORY_MB" != ""; then
- if test "$TOTAL_MEMORY_MB" != ""; then
+ # 0 is default which should mean 100
+ if (( jvm_heapSizeAsPercentageOfPhysicalMemory <= 0 )); then
+ jvm_heapSizeAsPercentageOfPhysicalMemory=100
+ fi
+
+ if (( jvm_heapSizeAsPercentageOfPhysicalMemory != 100 || TOTAL_MEMORY_MB != 0 )); then
+ if (( TOTAL_MEMORY_MB != 0 )); then
available="$TOTAL_MEMORY_MB"
else
available=`free -m | grep Mem | tr -s ' ' | cut -f2 -d' '`