GC is a marvel of Java.
How to get GC Log so that we know what iss is happening , what is the foot print of execution phase image:
Let us explore the switches available for GC collection statistics in JVM
GC Logging Flags in Java 8 and Earlier
-XX:+PrintGC
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps and -XX:+PrintGCTimeStamps
-Xloggc
eg : java -cp $CLASSPATH -Xloggc mypackage.MainClass
or
java -cp $CLASSPATH -Xloggc:/tmp/gc.log mypackage.MainClass
GC Logging Flags in Java 9 and Later
eg:
java -cp $CLASSPATH -Xlog:gc*=debug:file=/tmp/gc.log mypackage.MainClass
java -cp $CLASSPATH -Xlog:gc*=debug:stdout -Xlog:gc*=debug:file=/tmp/gc.log mypackage.MainClass
No comments:
Post a Comment