JEP 490: ZGC: Remove the Non-Generational Mode
Owner | Axel Boldt-Christmas |
Type | Feature |
Scope | JDK |
Status | Integrated |
Release | 24 |
Component | hotspot / gc |
Discussion | hotspot dash gc dash dev at openjdk dot org |
Effort | XS |
Duration | XS |
Relates to | JEP 439: Generational ZGC |
JEP 474: ZGC: Generational Mode by Default | |
Reviewed by | Stefan Karlsson, Vladimir Kozlov |
Endorsed by | Vladimir Kozlov |
Created | 2024/07/08 08:41 |
Updated | 2024/11/01 13:13 |
Issue | 8335850 |
Summary
Remove the non-generational mode of the Z Garbage Collector (ZGC).
Goal
- Reduce the maintenance cost of supporting two different modes.
Motivation
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.
Description
Remove the non-generational mode by obsoleting the ZGenerational
option and removing the non-generational ZGC code and its tests. The option will expire in a future release, at which point it will not be recognized by the HotSpot JVM, which will refuse to start.
After these changes, the relevant command-line options will work as follows:
-
-XX:+UseZGC
- Generational ZGC is used.
-
-XX:+UseZGC -XX:+ZGenerational
- Generational ZGC is used.
- An obsolete-option warning is printed.
-
-XX:+UseZGC -XX:-ZGenerational
- Generational ZGC is used.
- An obsolete-option warning is printed.
Workloads that switch to Generational ZGC may experience differences in log output and in the data available from the serviceability and management APIs.
Risks and Assumptions
This JEP shares its Risk and Assumptions with JEP 439: Generational ZGC and JEP 474: ZGC: Generational Mode by Default.
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 modes of ZGC over the long term.
Specific risks include:
-
Users may be required to adjust configurations that are tuned for non-generational ZGC.
-
The obsolete-option warning messages might cause issues.
-
Workloads that are tightly coupled to JVM internals, GC logs, and the data available via management interfaces may require extra attention.