HotSpot JVM - Young Generation Garbage Collectors

The HotSpot JVM provides several garbage collectors (GC) optimized for different scenarios. This section focuses on young generation collectors, which are primarily responsible for handling short-lived objects.

While these collectors are foundational and important for understanding GC mechanisms, many of them are now considered legacy and are being gradually phased out in favor of more modern collectors like G1, ZGC, and Shenandoah.

Serial Collector

Note: In modern server-side applications, the Serial collector is mostly used for testing or very small footprint systems. It is no longer the default for most environments since G1 has become the default collector in newer JDKs (since JDK 9).

ParNew Collector

Deprecated Feature:
As of JDK 14, the CMS collector has been removed, and thus ParNew is obsolete and no longer recommended.
Consider using G1 or ZGC instead for low-pause-time requirements.

Parallel Scavenge Collector

note: The Parallel GC (Parallel Scavenge + Parallel Old) is still available and maintained.
However, it is being gradually replaced by G1 GC, which offers a better balance between throughput and pause time.