From 79fedccdd9c7b424fb5610c271dbe48d174b6cf7 Mon Sep 17 00:00:00 2001 From: Silvio Giebl Date: Sat, 27 Apr 2024 00:37:26 +0200 Subject: [PATCH] Group heapdump related commands in run scripts --- src/distribution/bin/diagnostics.sh | 12 ++++++------ src/distribution/bin/run.sh | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) 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"