Skip to content

Commit d69cae2

Browse files
suyograojordansissel
authored andcommitted
Add option for JVM to dump its heap on OutOfMemory
Fixes #4192 Fixes #4205
1 parent 29b6301 commit d69cae2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/logstash.lib.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ setup_java() {
3535

3636
JAVA_OPTS="$JAVA_OPTS -XX:CMSInitiatingOccupancyFraction=75"
3737
JAVA_OPTS="$JAVA_OPTS -XX:+UseCMSInitiatingOccupancyOnly"
38+
# Causes the JVM to dump its heap on OutOfMemory.
39+
JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
40+
# The path to the heap dump location, note directory must exists and have enough
41+
# space for a full heap dump.
42+
JAVA_OPTS="$JAVA_OPTS -XX:HeapDumpPath=${LOGSTASH_HOME}/heapdump.hprof"
3843
fi
3944

4045
if [ "$LS_JAVA_OPTS" ] ; then

0 commit comments

Comments
 (0)