Description
In java 8, this will be on by default. In the next non-security Java 7 release, it is going to be available via the -XX:+PrintGCCause flag (it's currently available in ea build)
The AbstractGCEvent.parse method currently barfs when hit with a GC log message that comes out of something with the PrintGCCause information in it:
the log entries look like:
"GC pause (G1 Evacuation Pause) (young)"
This will not be just for G1, this additional detail will be provided for all collectors - it makes the parsing in AbstractGCEvent.parse a bit trickier because it will have to know that
"GC pause (G1 Evacuation Pause) (young)"
"GC pause (G1 Humongous Allocation) (young)"
both map to:
"GC pause (young)"
Looking at the JDK7 / JDK8 sources - the constants are defined in the gcCause.cpp file:
System.gc()
FullGCAlot
ScavengeAlot
Allocation Profiler
JvmtiEnv ForceGarbageCollection
GCLocker Initiated GC
Heap Inspection Initiated GC
Heap Dump Initiated GC
No GC
Allocation Failure
Tenured Generation Full
Metadata GC Threshold
CMS Generation Full
CMS Initial Mark
CMS Final Remark
Old Generation Expanded On Last Scavenge
Old Generation Too Full To Scavenge
Ergonomics
G1 Evacuation Pause
G1 Humongous Allocation
Last ditch collection
ILLEGAL VALUE - last gc cause - ILLEGAL VALUE
unknown GCCause
Java 7 has
Permanent Generation Full
instead of "Metadata GC Threshold"
I can help with a patch if you have an idea of where this might be easiest to wedge in