JDK-8354079 : JEP 521: Shenandoah: Make the generational mode be non-experimental
  • Type: CSR
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 25
  • Submitted: 2025-04-08
  • Updated: 2025-05-21
  • Resolved: 2025-05-21
Related Reports
CSR :  
Relates :  
Description
## Summary

Shenandoah's operational mode is controlled through the existing product option: `-XX:ShenandoahGCMode=[satb|passive|generational]`. Selecting the `generational` mode currently requires the flag `-XX:UnlockExperimentalVMOptions`. This CSR would make the `generational` mode no longer experimental.

## Problem

JEP 404 introduced a generational mode to the Shenandoah garbage collector. This mode allows the collector to run more efficiently by focusing efforts on regions of the heap which are more likely to contain fewer live objects. The option to enable this mode should be available to users without requiring the `-XX:+UnlockExperimentalVMOptions` flag. We do not intend to make the generational mode the default at this time.

## Solution

Shenandoah uses an internal mechanism to enforce the presence of `UnlockExperimentalVMOptions` for experimental modes. We simply need to change the configuration for the generational mode.

## Specification 

```
diff --git a/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.hpp b/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.hpp
index 0946858169a..26020777693 100644
--- a/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.hpp
+++ b/src/hotspot/share/gc/shenandoah/mode/shenandoahGenerationalMode.hpp
@@ -32,7 +32,7 @@ class ShenandoahGenerationalMode : public ShenandoahMode {
   virtual void initialize_flags() const;
   virtual const char* name()     { return "Generational"; }
   virtual bool is_diagnostic()   { return false; }
-  virtual bool is_experimental() { return true; }
+  virtual bool is_experimental() { return false; }
   virtual bool is_generational() { return true; }
 };
```
Comments
Moving to Approved.
21-05-2025

[~wkemper], no, as the CSR group lead, I move the CSR to Approved. As documented on the CSR wiki, to formally request the second phase of CSR review, the assignee of the CSR, currently yourself, transitions the CSR from Provisional to Finalized.
21-05-2025

[~rkennke] reviewed this CSR, he is the nominal project lead for Shenandoah. Should he be the one to move the CSR to `approved`?
21-05-2025

Moving to Provisional, not Approved.
20-05-2025

Moving to Proposed, not Approved or Provisional. [~wkemper], a Finalized request needs an area reviewer. Please have one or more GC engineers review this request before it is Finalized.
20-05-2025

[~wkemper], CSR are _not_ JEPs please don't assign them to be. See the CSR process docs for details: https://wiki.openjdk.org/display/csr/Main In particular note the nominal SLA for CSR review is one week and we are past the point were JEPs should be initiating engagement with the CSR process for JDK 25: https://mail.openjdk.org/pipermail/jdk-dev/2025-May/010028.html
19-05-2025

[~darcy], please have a look at this CSR. We are trying to make Shenandoah's generational mode be a product feature. The associated PR requires this CSR to be approved. Please let us know if anything more is needed here. Thank you!
19-05-2025