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:+ZGenerational
is no longer required.โ The old non-generational ZGC is no longer available.
Last updated