advanced~4h

Garbage Collection Fundamentals

What 'Java is a managed language' actually means mechanically: how the JVM proves an object is truly unreachable, why the heap is split into generations built around the observation that most objects die young, and a tour of the major collectors -- Serial, Parallel, G1, ZGC and Shenandoah -- and the specific problem each one exists to solve.

Learning objectives

  • Explain reachability and why it, not reference counting, is how the JVM decides an object is garbage
  • Explain the generational hypothesis and why it justifies splitting the heap into Young and Old generations
  • Distinguish a minor GC from a major/full GC and explain why their costs differ so much
  • Explain what a stop-the-world pause is and why every collector has to cause one at some point
  • Describe, at a conceptual level, what problem each of Serial, Parallel, G1, ZGC and Shenandoed collector solves

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Core Java Mastery library.

Garbage Collection Fundamentals

Next Step

Continue to Garbage Collection Tuning →← Back to all JVM Performance Engineering chapters