Skip to content

Commit

Permalink
Group heapdump related commands in run scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtSilvio committed Apr 26, 2024
1 parent 7e0ed52 commit 79fedcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/distribution/bin/diagnostics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions src/distribution/bin/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 79fedcc

Please sign in to comment.