JEP 490: ZGC: Remove the Non-Generational Mode
π§ JEP 490: ZGC β Remove the Non-Generational Mode
π What is ZGC?
ZGC (Z Garbage Collector) is a low-latency, concurrent, and scalable garbage collector introduced in JDK 11.
It was originally non-generational β treating all objects the same regardless of age.
π What Does JEP 490 Do?
It removes the old non-generational mode of ZGC and makes the generational mode the only option.
β Now, ZGC is always generational.
π― Why Remove the Non-Generational Mode?
Treated all objects equally
Separates young vs old objects
More CPU/memory overhead
Faster minor collections
Less predictable performance
Lower pause times, better throughput
π§ͺ Key Benefit in Practice:
Generational GC improves performance by:
Focusing frequent collections on short-lived (young) objects.
Delaying collection of long-lived (old) objects, which change less often.
This reduces the cost of GC and improves overall application responsiveness.
π
Timeline:
JDK 11β20
Non-generational (default)
JDK 21
Generational (preview)
JDK 22+
Generational becomes default
π₯ JDK 24
Non-generational is removed (JEP 490)
π§° Impact for Developers
β No config needed to enable generational ZGC β it's default.
π§Ή The option
-XX:+ZGenerationalis no longer required.β The old non-generational ZGC is no longer available.
Last updated