Concurrent mark sweep (CMS) garbage collection

The concurrent mark sweep (CMS) algorithm for garbage collection scans heap memory using multiple threads. Similar to the mark and sweep method, it marks objects for removal and then makes a sweep to actually remove those objects. This method of garbage collection is essentially an upgraded mark and sweep method. It was modified to take advantage of faster systems and had performance enhancements.

To manually invoke the concurrent mark sweep garbage collection algorithm for your application, use the following command-line option:

-XX:+UseConcMarkSweepGC 

If you want to use the concurrent mark sweep garbage collection algorithm and dictate the number of threads to use, you can use the following ...

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.