Summary
Enhance the Shenandoah garbage collector with experimental generational capabilities to improve sustainable throughput, load-spike resilience, and memory utilization.
Problem
Objects tend to have bimodal lifetimes, with the large majority dying young. However, some programs have a large corpus of data that tends to be longer-lived. Non-generational collectors such as Shenandoah tend to spend time and cpu cycles tracing these older, longer-lived objects but finding little space to reclaim. Generational collectors tend to be more efficient by focusing effort on younger, more recently created objects where one is more likely to reclaim free space.
Solution
Since most objects die young, and objects that survive longer tend to be relatively long-lived, generational collectors focus GC effort on younger objects, tenuring longer-lived objects to the older generation where they do not need to be examined as often by GC. All GCs in HotSpot today, other than Shenandoah, are generational. This JEP extends Shenandoah with an experimental generational mode of operation.
Specification
When Shenandoah is enabled in the usual manner via
-XX:+UseShenandoahGC
the new experimental generational feature may be optionally enabled via the JVM command line options
-XX:+UnlockExperimentalVMOptions -XX:ShenandoahGCMode=generational
The generational feature and any additional new flags governing its behavior are classified as Experimental. These new Experimental flags are evolving and subject to further change. They may be found in the PR associated with the linked Implementation task.
No new product flags have been added and no existing product flags have been modified.
When the generational mode isn't enabled, Shenandoah continues to behave as before.
When the generational mode is enabled, there will be two MX memory pool beans representing the heap: Shenandoah Young Gen
and Shenandoah Old Gen
. All other modes continue to use the existing, single memory pool bean: Shenandoah
.
- csr of
-
JDK-8337511 Implement JEP 404: Generational Shenandoah (Experimental)
- Open
-
JDK-8307314 Implementation: Generational Shenandoah (Experimental)
- Closed