Parallelize the Full GC Phase in CMS

In Chapter 7, Leveraging the New Default G1 Garbage Collector, we reviewed the changes to the Concurrent Mark Sweep (CMS) garbage collector. CMS garbage collection involves scanning heap memory, marking objects for removal and then making a sweep to actually remove those objects. The CMS method of garbage collection is essentially an upgraded "Mark and Sweep" method; which you can refer to Chapter 7, Leveraging the New Default G1 Garbage Collector, for additional information.

The current downside to CMS garbage collection is that the serial mark and sweep is implemented using a single thread. This results in unwanted pause times. Currently, full garbage collection takes place in four phases:

  • Marking phase ...

Get Java 9: Building Robust Modular Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.