ParNew Collector - Tenuring Age Distribution

This section demonstrates that the ParNew Collector uses Tenuring Age Distribution to perform Young generation GC.

Does the ParNew collector use Tenuring Age Distribution? Let's use our second test program, GarbageCollection2.java to find out:

C:\herong>java -XX:+UseConcMarkSweepGC
   -Xms1200m -Xmx1200m -XX:NewRatio=1 -XX:SurvivorRatio=1
   -Xlog:gc,gc+heap=debug,gc+age=trace
   GarbageCollection2 > output.txt

C:\herong>type output.txt
[info ][gc     ] Using Concurrent Mark Sweep
Step/TotalMemory/FreeMemory/UsedMemory:
1   1048576000   1040187352   8388648

...
193   1048576000   839906280   208669720
[gc,age ] GC(0) Desired survivor size 104857600 bytes,
                new threshold 15 (max threshold 15)
[gc,age ] GC(0) Age table with threshold 15 (max threshold 15)
[gc,age ] GC(0) - age   1:   33258632 bytes,   33258632 total

[gc,heap] GC(0) ParNew: 203779K->32501K(409600K)
[gc,heap] GC(0) CMS: 0K->0K(614400K)
[gc] GC(0) Pause Young (Allocation Failure) 199M->31M(1000M) 22.755ms

...
390   1048576000   805660552   242915448
[gc,age ] GC(1) Desired survivor size 104857600 bytes,
                new threshold 15 (max threshold 15)
[gc,age ] GC(1) Age table with threshold 15 (max threshold 15)
[gc,age ] GC(1) - age   1:   32506352 bytes,   32506352 total
[gc,age ] GC(1) - age   2:     752000 bytes,   33258352 total

[gc,heap] GC(1) ParNew: 237222K->32612K(409600K)
[gc,heap] GC(1) CMS: 0K->0K(614400K)
[gc] GC(1) Pause Young (Allocation Failure) 231M->31M(1000M) 16.683ms

...
2178   1048576000   805243072   243332928
[gc,age ] GC(10) Desired survivor size 104857600 bytes,
                 new threshold 15 (max threshold 15)
[gc,age ] GC(10) Age table with threshold 15 (max threshold 15)
[gc,age ] GC(10) - age   1:   32506352 bytes,   32506352 total
[gc,age ] GC(10) - age   2:        120 bytes,   32506472 total
[gc,age ] GC(10) - age   6:        648 bytes,   32507120 total
[gc,age ] GC(10) - age   8:        864 bytes,   32507984 total
[gc,age ] GC(10) - age   9:        192 bytes,   32508176 total
[gc,age ] GC(10) - age  11:     751968 bytes,   33260144 total

[gc,heap] GC(10) ParNew: 237629K->32940K(409600K)
[gc,heap] GC(10) CMS: 0K->0K(614400K)
[gc] GC(10) Pause Young (Allocation Failure) 232M->32M(1000M) 7.123ms

The output confirms that the ParNew collector does use tenuring age distribution to perform Young generation GC, similar to the Serial collector.

Table of Contents

 About This Book

 Heap Memory Area and Size Control

 JVM Garbage Collection Logging

 Introduction of Garbage Collectors

 Serial Collector - "+XX:+UseSerialGC"

 Parallel Collector - "+XX:+UseParallelGC"

Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"

 What Is Concurrent Mark-Sweep (CMS) Collector

 Concurrent Mark-Sweep Collector GC Log Message Format

 Reduce Stop-The-World with Concurrent Mark and Sweep

 Parallel New (ParNew) Collector for Minor GC

ParNew Collector - Tenuring Age Distribution

 Maximium Logging of All Phases on Young GC

 "-XX:ParallelGCThreads=6" - Young GC Parallel Threads

 "-XX:MaxTenuringThreshold=0" - Tenuring Objects Immediately

 "-XX:CMSInitiatingOccupancyFraction=20" - Initiate CMS

 Maximium Logging of All Phases on Old GC

 Maximium Logging of All Phases on Full GC

 "-XX:ParallelGCThreads=6" - Old GC Parallel Threads

 "-XX:ConcGCThreads=3" - Old GC Concurrent Threads

 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

 Garbage Collection Performance Test Summary

 References

 Full Version in PDF/EPUB