Skip to content

Instantly share code, notes, and snippets.

@rafaeltuelho
Last active May 21, 2018 11:57
Show Gist options
  • Save rafaeltuelho/f3334d3526bdb0e6d3f2cc41a79e0523 to your computer and use it in GitHub Desktop.
Save rafaeltuelho/f3334d3526bdb0e6d3f2cc41a79e0523 to your computer and use it in GitHub Desktop.
Useful JVM command line arguments (gc logging)
  • used to start a Standalone EAP instance:
/usr/lib/jvm/java/bin/java -D[Standalone] -server \
-verbose:gc \
-Xloggc:$EAP_HOME/standalone/log/gc_%p_%t.log \
-XX:+PrintGCDetails \
-XX:+PrintGCDateStamps \
-XX:+UseGCLogFileRotation \
-XX:NumberOfGCLogFiles=5 \
-XX:GCLogFileSize=3M \
-XX:-TraceClassUnloading \
-Xms1303m -Xmx1303m \
-XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m \
-Djava.net.preferIPv4Stack=true \
-Djboss.modules.system.pkgs=org.jboss.byteman \
-Djava.awt.headless=true \
-Dorg.jboss.boot.log.file=$EAP_HOME/standalone/log/server.log \
-Dlogging.configuration=file:$EAP_HOME/standalone/configuration/logging.properties

NOTE: the GC Logging rotation and __%p __%t "placeholders" on -Xloggc: option is only available on recent releases of JDK '.8. See https://bugs.openjdk.java.net/browse/JDK-7164841

@dev3loperb
Copy link

dev3loperb commented Apr 24, 2018

Thanks, great!

Would like to add:
%p is used for PID of the process
%t is used for timestamp YYYY-MM-DD_HH-MM-SS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment