Summary
The proposed change removes the use of non-generational ZGC by obsoleting the ZGenerational option.
Problem
Maintaining two different modes of ZGC comes at a cost. As a step in reducing the future maintenance burden and technical debt the non-generational mode of ZGC will be phased out through the deprecation process.
For more details see JEP 474: ZGC: Generational Mode by Default
(JDK-8326667) and JEP 490: ZGC: Remove the Non-Generational Mode
(JDK-8335850).
Solution
JEP 439: https://openjdk.org/jeps/439 introduced Generational ZGC as a second mode of ZGC to allow for a smoother transition for users from the non-generational ZGC. JEP 474: https://openjdk.org/jeps/474 made the generational mode the default mode of ZGC and the flag ZGenerational
deprecated. As the final step in phasing out non-generational ZGC the flag ZGenerational
will be made obsolete.
This will entail obsoleting ZGenerational
via the standard HotSpot Command-line Flag lifecycle process.
For more details see JEP 490: ZGC: Remove the Non-Generational Mode
(JDK-8335850).
Specification
Draft PR: https://github.com/openjdk/jdk/pull/21401
After the change specifying -XX:+UseZGC
will always run in the generational mode. Specifying ZGenerational
will result in a obsolete VM option warning.
- All product flags (except
ZGenerational
andZVerifyViews
) will have similar behavior- The flag
ZCollectionInterval
can be specified with finer granularity via:ZCollectionIntervalMinor
- "Force Minor GC at a fixed time interval (in seconds)"ZCollectionIntervalMajor
- "Force GC at a fixed time interval (in seconds)"
- The flag
ConcGCThreads
can be specified with generational granularity via:ZYoungGCThreads
- "Number of GC threads for the young generation"ZOldGCThreads
- "Number of GC threads for the old generation"
- The flag
ZFragmentationLimit
is used for the old generation, young generations is configured via:ZYoungCompactionLimit
- "Maximum allowed garbage in young pages"
- The diagnostic
ZVerifyViews
option will be removed. - The
ZGenerational
option will be obsolete.
- The flag
Because Generational ZGC has two generations and the non-generational ZGC only has one, there will be a difference in the number entities in various serviceability layers:
Memory Pools:
- "ZGC Young Generation", "ZGC Old Generation"
Memory Managers:
- "ZGC Minor Cycles", "ZGC Minor Pauses", "ZGC Major Cycles", "ZGC Major Pauses"
The same is true for the HotSpot performance counters.
- csr of
-
JDK-8341692 Implement JEP 490: ZGC: Remove the Non-Generational Mode
-
- Resolved
-
- relates to
-
JDK-8335850 JEP 490: ZGC: Remove the Non-Generational Mode
-
- Closed
-