You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2021/10/21 09:38:31 UTC

[activemq-artemis] branch main updated: ARTEMIS-3528 only enable JVM debug options for 'run' command

This is an automated email from the ASF dual-hosted git repository.

gtully pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new b459fe5  ARTEMIS-3528 only enable JVM debug options for 'run' command
b459fe5 is described below

commit b459fe50752d30eaf60f5a6cafe8da276730da31
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Fri Oct 15 11:16:19 2021 -0500

    ARTEMIS-3528 only enable JVM debug options for 'run' command
---
 .../artemis/cli/commands/etc/artemis.profile       | 26 ++++++++++++----------
 .../artemis/cli/commands/etc/artemis.profile.cmd   |  5 +++--
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
index 9dfb5e7..a5b4c96 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile
@@ -30,30 +30,32 @@ ARTEMIS_INSTANCE_ETC_URI='${artemis.instance.etc.uri}'
 # Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
 #ARTEMIS_CLUSTER_PROPS="-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446"
 
-
 # Hawtio Properties
 HAWTIO_ROLE='${role}'
 
-
 # Java Opts
 if [ -z "$JAVA_ARGS" ]; then
     JAVA_ARGS="-XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=${ARTEMIS_INSTANCE_ETC_URI}jolokia-access.xml ${java-opts}"
 fi
 
+# Uncomment to enable logging for Safepoint JVM pauses
+#
+# In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause
+# that could affect the latencies of the services delivered by the broker, including those that are not reported by
+# the classic GC logs and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted
+# loops and obviously GC activity).
 #
-# Logs Safepoints JVM pauses: Uncomment to enable them
-# In addition to the traditional GC logs you could enable some JVM flags to know any meaningful and "hidden" pause that could
-# affect the latencies of the services delivered by the broker, including those that are not reported by the classic GC logs
-# and dependent by JVM background work (eg method deoptimizations, lock unbiasing, JNI, counted loops and obviously GC activity).
 # Replace "all_pauses.log" with the file name you want to log to.
 # JAVA_ARGS="$JAVA_ARGS -XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1 -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCApplicationConcurrentTime -XX:+LogVMOutput -XX:LogFile=all_pauses.log"
 
-#
-# Enables the dumping of the java heap when a java.lang.OutOfMemoryError exception is thrown.
+# Uncomment to enable the dumping of the Java heap when a java.lang.OutOfMemoryError exception is thrown
 # JAVA_ARGS="$JAVA_ARGS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${ARTEMIS_OOME_DUMP}"
 
-# Debug args: Uncomment to enable debug
-#DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
+# Only enable debug options for the 'run' command
+if [ "$1" = "run" ]; then :
+    # Uncomment to enable remote debugging
+    # DEBUG_ARGS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
 
-# Debug args: Uncomment for async profiler
-#DEBUG_ARGS="-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints"
+    # Uncomment for async profiler
+    # DEBUG_ARGS="-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints"
+fi
\ No newline at end of file
diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd
index 828efc6..b38d970 100644
--- a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd
+++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/artemis.profile.cmd
@@ -45,5 +45,6 @@ rem set JAVA_ARGS=%JAVA_ARGS% -XX:+PrintSafepointStatistics -XX:PrintSafepointSt
 rem Enables the dumping of the java heap when a java.lang.OutOfMemoryError exception is thrown.
 rem set JAVA_ARGS=%JAVA_ARGS% -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=%ARTEMIS_OOME_DUMP%
 
-rem Debug args: Uncomment to enable debug
-rem set DEBUG_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
+rem Only enable debug options for the 'run' command
+rem Uncomment to enable remote debugging
+rem if "%1"=="run" set DEBUG_ARGS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
\ No newline at end of file