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 ...