Generational Garbage Collection in HotSpot

This section describes the generational garbage collection architecture used in the HotSpot JVM. Young Generation stores objects with shorter lives and Tenured Generation stores objects with longer lives.

Earlier we learned the garbage collector's role and responsibilities. Now let's look at a real example, the garbage collector implemented in the HotSpot JVM.

Architecturally, the HotSpot garbage collector is called Generational Collector, which divides the memory into two parts (generations):

A new objects is normally allocated in the Young Generation first. If it survives some number of Minor GC, it will be then promoted to the Tenured Generation.

The generational garbage collection approach is more efficient because of the following weak generational hypothesis observed in most Java applications:

The picture below illustrates the generational garbage collection architecture used in HotSpot JVM:

HotSpot Generational Garbage Collection
HotSpot Generational Garbage Collection

Last update: 2018.

Table of Contents

 About This Book

 Heap Memory Area and Size Control

 JVM Garbage Collection Logging

Introduction of Garbage Collectors

 JVM Memory Manager - Garbage Collector

Generational Garbage Collection in HotSpot

 Young Generation Collection - Minor GC

 Young Generation Collectors - Serial, PS, ParNew, G1

 Tenured Generation Collection - Major GC

 Tenured Generation Collectors - Serial, ParOldGen, CMS, G1

 Collector Combinations: Serial, Parallel, Concurrent, G1

 Serial Collector - "+XX:+UseSerialGC"

 Parallel Collector - "+XX:+UseParallelGC"

 Concurrent Mark-Sweep (CMS) Collector - "+XX:+UseConcMarkSweepGC"

 Garbage First (G1) Collector - "+XX:+UseG1GC"

 Object References and Garbage Collection

 Garbage Collection Performance Test Program

 Performance Tests on Serial Collector

 Performance Tests on Parallel collector

 Performance Tests on Concurrent collector

 Performance Tests on G1 collector

 Garbage Collection Performance Test Summary

 Outdated Tutorials


 Full Version in PDF/EPUB