Generational Shenandoah

Java 25 Course · lesson 8 of 16 · 3 min read

The second low-pause collector learns the same generational trick ZGC did.

Open this lesson in the learning hub

Key points

  • Shenandoah targets low pauses by evacuating objects concurrently with your application.
  • Like early ZGC, it treated the heap as one region set and re-scanned long-lived objects repeatedly.
  • JEP 521 finalises a generational mode that collects the young generation far more often.
  • The result is the same pause profile at noticeably lower CPU cost and better throughput.
  • Choosing between ZGC and Shenandoah is now mostly about your platform and measurements, not features.

Both low-pause collectors are now generational - the choice comes down to measurement, not capability.

This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the Java 25 Course course, and every lesson in it is listed on the Java 25 Course contents page.