diff --git a/src/distribution/bin/diagnostics.sh b/src/distribution/bin/diagnostics.sh index 316b304d0..4c7b87862 100755 --- a/src/distribution/bin/diagnostics.sh +++ b/src/distribution/bin/diagnostics.sh @@ -73,12 +73,6 @@ else fi HOME_OPT="-Dhivemq.home=$HIVEMQ_FOLDER" -if [ -z "$HIVEMQ_HEAPDUMP_FOLDER" ]; then - HEAPDUMP_PATH="$HIVEMQ_FOLDER" -else - HEAPDUMP_PATH="$HIVEMQ_HEAPDUMP_FOLDER" -fi - if [ ! -d "$HIVEMQ_FOLDER" ]; then echoerr 'ERROR! HiveMQ Home Folder not found.' exit 1 @@ -96,6 +90,12 @@ if [ ! -f "$JAR_PATH" ]; then exit 1 fi +if [ -z "$HIVEMQ_HEAPDUMP_FOLDER" ]; then + HEAPDUMP_PATH="$HIVEMQ_FOLDER" +else + HEAPDUMP_PATH="$HIVEMQ_HEAPDUMP_FOLDER" +fi + JAVA_OPTS="$JAVA_OPTS -XX:+CrashOnOutOfMemoryError" JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" HEAPDUMP_PATH_OPT="-XX:HeapDumpPath=$HEAPDUMP_PATH/heap-dump.hprof" diff --git a/src/distribution/bin/run.sh b/src/distribution/bin/run.sh index ef99deea4..a989a5fa7 100755 --- a/src/distribution/bin/run.sh +++ b/src/distribution/bin/run.sh @@ -72,12 +72,6 @@ else fi HOME_OPT="-Dhivemq.home=$HIVEMQ_FOLDER" -if [ -z "$HIVEMQ_HEAPDUMP_FOLDER" ]; then - HEAPDUMP_PATH="$HIVEMQ_FOLDER" -else - HEAPDUMP_PATH="$HIVEMQ_HEAPDUMP_FOLDER" -fi - if [ ! -d "$HIVEMQ_FOLDER" ]; then echoerr 'ERROR! HiveMQ Home Folder not found.' exit 1 @@ -95,6 +89,12 @@ if [ ! -f "$JAR_PATH" ]; then exit 1 fi +if [ -z "$HIVEMQ_HEAPDUMP_FOLDER" ]; then + HEAPDUMP_PATH="$HIVEMQ_FOLDER" +else + HEAPDUMP_PATH="$HIVEMQ_HEAPDUMP_FOLDER" +fi + JAVA_OPTS="$JAVA_OPTS -XX:+CrashOnOutOfMemoryError" JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError" HEAPDUMP_PATH_OPT="-XX:HeapDumpPath=$HEAPDUMP_PATH/heap-dump.hprof"