Java VM debugging flags

If you want to see what’s going on inside a JVM, use these flags at a minimum:
-XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -verbose:gc -Xloggc:/path/to/logfile/gc.log

You can also add these options to obtain data from the JVM:

-XX:+PrintHeapUsageOverTime Print heap usage and capacity with timestamps
-XX:+PrintGCApplicationStoppedTime Measure the length of the collection pauses.
-XX:+PrintTLAB Trace all the operations on TLAB’s (Thread Allocation Buffers)
-XX:+PrintGCApplicationConcurrentTime Measure the amount of time the applications runs between collection pauses
-XX:+PrintTenuringDistribution Gives the aging distribution of the allocated objects in the young generation.
-XX:+TLABStats
-XX:+PrintGCTaskTimeStamps