In those cases, CMS can be set so that it operates incrementally, which means that when the background thread runs (and there should never be more than one such thread), it doesn’t sweep through the entire heap at once. Having that background thread pause periodically will help overall throughput by making more CPU available to the application thread(s). When it does run, though, the application threads and the CMS thread will still compete for CPU cycles.
Incremental CMS is enabled by specifying the
flag. The rate at which the background thread yields to the
application threads is controlled by changing the values of the
Share this highlighthttp://learning.oreilly.com/a/java-performance-the/4591/