JDK-8307343 : Implementation: JEP 404: Generational Shenandoah (Experimental)
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 24
  • Submitted: 2023-05-03
  • Updated: 2025-05-20
  • Resolved: 2024-11-06
Related Reports
CSR :  
CSR :  
Relates :  
Relates :  
Description
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`.
Comments
Moving to Approved. Updated the Description to reflect the integration of JEP 490: ZGC: Remove the Non-Generational Mode.
06-11-2024

JMX change has been documented, the CSR reviewed, and its state progressed to "Finalized".
05-11-2024

[~wkemper] and [~ysr], from some outside email, it was implied there are other interfaces affected by this work, such as JMX. If so, please update the CSR to include all such JDK interfaces.
05-11-2024

Set target version to 24, but [~wkemper] will reach out to [~darcy] to check whether a CSR is even needed for this JEP.
04-11-2024

Cleared "Fix Version" preparatory to setting a target version soon.
31-07-2024

Placed back in "Draft", preparatory to moving again to "Proposed". Assigning to William Kemper. Thanks William!
31-07-2024

Moving this CSR to Withdrawn; if there is interest in the future, please re-open it.
27-11-2023

[~ysr], if there is no longer interest in this CSR, please Withdraw it. Thanks.
26-10-2023

Thanks [~ysr], I changed the fixVersion to 22 and moved the CSR back to Provisional. When this is ready for JDK 22, please re-Finalize the request, reflecting any changes to the command line interface, etc.
08-06-2023

The parent JEP is being dropped from JDK 21, and will likely be retargeted to JDK 22 in the future. Not sure if CSR state needs to change in any manner to reflect this, but leaving this comment here in case anything needs to happen. Should the information in this CSR need to be adjusted in the future, we'll reach back here to check at that time.
08-06-2023

Moving to Approved.
26-05-2023

Thank you for the reviews/feedback. Moving to "Finalize".
25-05-2023

Moving to "Proposed".
25-05-2023