Java GC Tutorials - Herong's Tutorial Examples - v1.12, by Herong Yang
Log Message Types from Serial Collector
This section describes various types of log messages generated from the Serial Collector with the '-Xlog:gc*=debug' option.
If you run your application using the Serial Collector (-XX:+UseSerialGC) with the "-Xlog:gc*=debug" logging option, you may see the following types of log messages:
1. Heap initial allocation - Reported when JVM starts:
[debug][gc,heap] Minimum heap 2097152 Initial heap 2097152 Maximum heap 67108864
2. Young generation heap reduction message - Reported as part of a Young GC process:
[info][gc,heap] GC(0) DefNew: 1024K->128K(1152K)
3. Tenured generation heap expansion message - Reported as part of a Young GC process:
[info][gc,heap] GC(0) Tenured: 0K->418K(768K)
4. Start/end of a Young GC:
[info][gc,start] GC(0) Pause Young (Allocation Failure) ... [info][gc] GC(0) Pause Young (Allocation Failure) 1M->0M(1M) 2.341ms
5. Object aging threshold - Reported as part of a Young GC:
[debug][gc,age] GC(0) Desired survivor size 65536 bytes, new threshold 1 (max threshold 15)
6. Metaspace reduction - Reported as part of a Young GC:
[0.059s][info ][gc,metaspace] GC(0) Metaspace: 328K->328K(1056768K)
7. GC execution time - Reported as part of a Young or Full GC:
[info][gc,cpu] GC(0) User=0.00s Sys=0.00s Real=0.00s
8. Heap snapshot report before GC - Reported before a Young GC or Full GC process:
[debug][gc,heap] GC(0) Heap before GC invocations=0 (full 0): def new generation total 1152K, used 1024K [... [debug][gc,heap] GC(0) eden space 1024K, 100% used [... [debug][gc,heap] GC(0) from space 128K, 0% used [... [debug][gc,heap] GC(0) to space 128K, 0% used [... [debug][gc,heap] GC(0) tenured generation total 768K, used 0K [... [debug][gc,heap] GC(0) the space 768K, 0% used [... [debug][gc,heap] GC(0) Metaspace used 328K, capacity 4515K, committed 4864K, reserved 1056768K [debug][gc,heap] GC(0) class space used 30K, capacity 398K, committed 512K, reserved 1048576K
9. Heap snapshot report after GC - Reported before a Young GC or Full GC process:
[debug][gc,heap] GC(0) Heap after GC invocations=1 (full 0): def new generation total 1152K, used 128K [... [debug][gc,heap] GC(0) eden space 1024K, 0% used [... [debug][gc,heap] GC(0) from space 128K, 100% used [... [debug][gc,heap] GC(0) to space 128K, 0% used [... [debug][gc,heap] GC(0) tenured generation total 768K, used 418K [... [debug][gc,heap] GC(0) the space 768K, 54% used [... [debug][gc,heap] GC(0) Metaspace used 328K, capacity 4515K, committed 4864K, reserved 1056768K [debug][gc,heap] GC(0) class space used 30K, capacity 398K, committed 512K, reserved 1048576K
10. Start/end of a Full GC - Reported at the beginning of a Full GC:
[info ][gc,start] GC(2) Pause Full (Allocation Failure) ... [info ][gc] GC(2) Pause Full (Allocation Failure) 0M->0M(2M) 15004100.942ms
11. Mark phase of a Full GC:
[info][gc,phases,start] GC(2) Phase 1: Mark live objects ... [info][gc,phases] GC(2) Phase 1: Mark live objects 15004095.903ms
12. New address calculation phase of a Full GC:
[info][gc,phases,start] GC(2) Phase 2: Compute new object addresses [info][gc,phases] GC(2) Phase 2: Compute new object addresses 2.754ms
13. Adjust pointers phase of a Full GC:
[info][gc,phases,start] GC(2) Phase 3: Adjust pointers [info][gc,phases] GC(2) Phase 3: Adjust pointers 1.896ms
14. Move objects phase of a Full GC:
[info][gc,phases,start] GC(2) Phase 4: Move objects [info][gc,phases] GC(2) Phase 4: Move objects 0.067ms
Table of Contents
Heap Memory Area and Size Control
JVM Garbage Collection Logging
Introduction of Garbage Collectors
►Serial Collector - "+XX:+UseSerialGC"
GC Log Message Format for Serial Collector
GC Log Message Examples of Serial Collector
►Log Message Types from Serial Collector
Serial Collector Stops Application for Minor/Major GC
Usage Report on Heap Memory Areas
Default NewRatio - Old vs. New Generation
"-XX:NewRatio" - Ratio of Tenured and "new" Generation
"-XX:SurvivorRatio" - Ratio of Eden and Survivor Space
Serial GC Tracing - Tight Heap
Serial GC Tracing - Tight Heap (Part 2)
Serial GC Tracing - Tight Heap (Part 3)
Serial GC Tracing - Plenty of Heap
Serial GC Tracing - Aged Live Objects
Serial GC Tracing - Tenuring Threshold
"-XX:TargetSurvivorRatio" - Second Tenuring Condition
Serial GC Tracing - Tenuring Threshold Controlled
"-XX:+NeverTenure" and "-XX:+AlwaysTenure" Working
Minor GC Triggering Condition of Serial Collector
Parallel Collector - "+XX:+UseParallelGC"
Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"
Garbage First (G1) Collector - "+XX:+UseG1GC"
The Z Garbage Collector (ZGC) - "+XX:+UseZGC"
Object References and Garbage Collection
Garbage Collection Performance Test Program
Performance Tests on Serial Collector
Performance Tests on Parallel collector
Performance Tests on Concurrent collector
Performance Tests on G1 collector