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?

Problem With Old Mode
Benefit of Generational ZGC

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 Version
ZGC Status

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