summaryrefslogtreecommitdiffstats
path: root/standalone-container
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-06-08 15:08:39 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-06-08 15:08:39 +0000
commitc13a435a8ee30ab46d2cdae38504446e794dec7e (patch)
tree628d96c00d082550e257f464392a695c911cfabd /standalone-container
parent26c06870f4d39e5a74bc32c17f2c88a14d23ca50 (diff)
Only enable -XX:+UseTransparentHugePages if heap is at least 2x hugepage size.
Diffstat (limited to 'standalone-container')
-rwxr-xr-xstandalone-container/src/main/sh/standalone-container.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/standalone-container/src/main/sh/standalone-container.sh b/standalone-container/src/main/sh/standalone-container.sh
index bee4c06c38d..3542ad3e540 100755
--- a/standalone-container/src/main/sh/standalone-container.sh
+++ b/standalone-container/src/main/sh/standalone-container.sh
@@ -167,10 +167,15 @@ StartCommand() {
FixDataDirectory "$bundlecachedir"
FixDataDirectory "$VESPA_HOME/var/crash"
+ # Note that the hardcoded memory Xmx=2048 migh be overridden by jvm_arguments,
+ # hence rendering get_jvm_hugepage_settings incorrect, but it is better than not.
+ # TODO Better way of extracting heap size arguments.
+ heap_min=128
+ heap_max=2048
java \
- -Xms128m -Xmx2048m \
+ -Xms$(heap_min)m -Xmx$(heap_max)m \
-XX:+PreserveFramePointer \
- -XX:+UseTransparentHugePages \
+ $(get_jvm_hugepage_settings $heap_max) \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath="$VESPA_HOME/var/crash" \
-XX:+ExitOnOutOfMemoryError \