JEP 474: ZGC: Generational Mode by Default

OwnerAxel Boldt-Christmas
Componenthotspot / gc
Discussionhotspot dash gc dash dev at openjdk dot org
Reviewed byStefan Karlsson, Vladimir Kozlov
Endorsed byVladimir Kozlov
Created2024/02/26 11:16
Updated2024/05/29 07:20


Switch the default mode of the Z Garbage Collector (ZGC) to the generational mode. Deprecate the non-generational mode, with the intent to remove it in a future release.




Maintaining non-generational ZGC slows the development of new features. As stated in JEP 439: Generational ZGC:

Generational ZGC should be a better solution for most use cases than non-generational ZGC. We should eventually be able to replace the latter with the former in order to reduce long-term maintenance costs.


Make Generational ZGC the default mode of ZGC by changing the default value of the ZGenerational option from false to true. Deprecate the non-generational mode by deprecating the ZGenerational option.

After these changes the following behavior will be observed based on the provided command-line arguments:

Workloads that switch to Generational ZGC may experience differences in log output and in the data available from the serviceability and management APIs.


We will ensure that existing tests are unaffected by the deprecated option warning and that they pass in the same configurations as before this change.

Risks and Assumptions

This JEP shares its Risk and Assumptions with JEP 439: Generational ZGC.

Generational ZGC will perform differently than non-generational ZGC. The main risk this presents is that some workloads are non-generational by nature, and thus could see a slight performance degradation. We believe that this is a sufficiently small set of workloads that it does not justify the cost of maintaining two separate versions of ZGC over the long term.

Specific risks include: