Java GC Tutorials - Herong's Tutorial Examples - v1.11, by Dr. Herong Yang
Serial GC Tracing - Tight Heap (Part 3)
This section provides part 3 of a tutorial on tracing how Serial GC works with a tight heap size.
The sixth GC happened as a Full GC after another 9 iterations, because the "eden" space was 99% full again with new objects.
25 40566784 9694584 30872200 26 40566784 8622920 31943864 27 40566784 7551256 33015528 28 40566784 6463192 34103592 29 40566784 5325976 35240808 30 40566784 4254312 36312472 31 40566784 3166248 37400536 32 40566784 2029032 38537752 33 40566784 1008048 39558736 [debug][gc,heap] GC(5) Heap before GC invocations=4 (full 1): def new generation total 12288K, used 12032K [... [debug][gc,heap] GC(5) eden space 10944K, 100% used [... [debug][gc,heap] GC(5) from space 1344K, 80% used [... [debug][gc,heap] GC(5) to space 1344K, 0% used [... [debug][gc,heap] GC(5) tenured generation total 27328K, used 27111K [... [debug][gc,heap] GC(5) the space 27328K, 99% used [... [info ][gc,heap] GC(5) DefNew: 12032K->9649K(12288K) [info ][gc,heap] GC(5) Tenured: 27111K->27316K(27328K) [info ][gc ] GC(5) Pause Full (Allocation Failure) 38M->36M(38M) 30.705ms [debug][gc,heap] GC(5) Heap after GC invocations=5 (full 2): def new generation total 12288K, used 9649K [... [debug][gc,heap] GC(5) eden space 10944K, 88% used [... [debug][gc,heap] GC(5) from space 1344K, 0% used [... [debug][gc,heap] GC(5) to space 1344K, 0% used [... [debug][gc,heap] GC(5) tenured generation total 27328K, used 27316K [... [debug][gc,heap] GC(5) the space 27328K, 99% used [...
Notes on the above GC:
The seventh GC happened as a Full GC after 2 iterations, because "eden" space could only take 2 more new 1MB objects from my application.
34 40566784 2103912 38462872 35 40566784 1041176 39525608 [debug][gc,heap] GC(6) Heap before GC invocations=5 (full 2): def new generation total 12288K, used 12287K [... [debug][gc,heap] GC(6) eden space 10944K, 100% used [... [debug][gc,heap] GC(6) from space 1344K, 99% used [... [debug][gc,heap] GC(6) to space 1344K, 0% used [... [debug][gc,heap] GC(6) tenured generation total 27328K, used 27319K [... [debug][gc,heap] GC(6) the space 27328K, 99% used [... [info ][gc,heap] GC(6) DefNew: 12287K->10301K(12288K) [info ][gc,heap] GC(6) Tenured: 27319K->27160K(27328K) [info ][gc ] GC(6) Pause Full (Allocation Failure) 38M->36M(38M) 60.615ms [debug][gc,heap] GC(6) Heap after GC invocations=6 (full 3): def new generation total 12288K, used 10301K [... [debug][gc,heap] GC(6) eden space 10944K, 94% used [... [debug][gc,heap] GC(6) from space 1344K, 0% used [... [debug][gc,heap] GC(6) to space 1344K, 0% used [... [debug][gc,heap] GC(6) tenured generation total 27328K, used 27160K [... [debug][gc,heap] GC(6) the space 27328K, 99% used [...
Notes on the above GC:
From this point on, the Serial collector continued perform Full GC every 2 to 4 iterations.
Conclusion:
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