Skip to content

Instantly share code, notes, and snippets.

@juliojsb
Created June 8, 2016 18:29
Show Gist options
  • Save juliojsb/550ae9c36a48d7e867e04391c7f04a0a to your computer and use it in GitHub Desktop.
Save juliojsb/550ae9c36a48d7e867e04391c7f04a0a to your computer and use it in GitHub Desktop.
JVM Flags for debugging
# Activate Automatic Heap Dump on OutOfMemory
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/path/to/location/`date +%Y%m%d`.hprof
# Activate basic GC logging
-XX:+PrintGC
# Activate detailed GC logging
-XX:+PrintGCDetails
# Add Timestamps (can be used with basic or detailed GC logging)
-XX:+PrintGCTimeStamps
# GC logging to a file
-Xloggc:/path/to/location/gc.log
# GC file rotation
-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M
# Check wheter a class is loaded or unloaded from the JVM
-XX:+TraceClassLoading
-XX:-TraceClassUnloading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment