From b33010a24cd645d9bf433974daa71a21c17c49f2 Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 23 Nov 2010 03:51:38 +0200 Subject: [PATCH] document the heap dump options --- bin/elasticsearch.in.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/elasticsearch.in.sh b/bin/elasticsearch.in.sh index 99ca3e6d60e..041f266ee7e 100644 --- a/bin/elasticsearch.in.sh +++ b/bin/elasticsearch.in.sh @@ -7,9 +7,14 @@ if [ "x$ES_MAX_MEM" = "x" ]; then ES_MAX_MEM=1g fi -# Arguments to pass to the JVM +# min and max heap sizes should be set to the same value to avoid +# stop-the-world GC pauses during resize, and so that we can lock the +# heap in memory on startup to prevent any of it from being swapped +# out. JAVA_OPTS="$JAVA_OPTS -Xms${ES_MIN_MEM}" JAVA_OPTS="$JAVA_OPTS -Xmx${ES_MAX_MEM}" + +# reduce the per-thread stack size JAVA_OPTS="$JAVA_OPTS -Xss128k" JAVA_OPTS="$JAVA_OPTS -Djline.enabled=true" @@ -29,5 +34,8 @@ JAVA_OPTS="$JAVA_OPTS -XX:MaxTenuringThreshold=1" JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=75" JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly" +# Causes the JVM to dump its heap on OutOfMemory. JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" -JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$ES_HOME/work/heap" +# The path to the heap dump location, note directory must exists and have enough +# space for a full heap dump. +#JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=$ES_HOME/logs/heapdump.hprof"