CMS GC: Legacy Throughput for Batch ML.

The Concurrent Mark Sweep (CMS) collector, though deprecated in recent JVM versions, historically provided good throughput for batch workloads by performing most of its work concurrently with application threads to minimize pause times for older Java applications.

The top 3

  1. CMS GC's Successor: G1's Rise: The Garbage-First (G1) collector largely superseded CMS as the default for Java 9+, offering a better balance of throughput and predictable pause times, especially for larger heaps, by partitioning the heap into regions and compacting memory concurrently.
  2. CMS GC's Fatal Flaw: Concurrent Mode Failure: A critical limitation of CMS was 'Concurrent Mode Failure,' occurring when the concurrent collection couldn't keep up with object allocation, forcing a stop-the-world (STW) full collection, negating its low-pause benefits.
  3. CMS GC's Memory Fragmentation Challenge: Unlike compacting collectors, CMS is a non-compacting collector, leading to heap fragmentation over time. This could prevent allocation of large objects, even with sufficient free memory, eventually triggering costly full GCs.

Sources

Open the full topic