Описание тега concurrent-mark-sweep
Concurrent-mark-sweep is a garbage collection algorithm, known for its use on the Java Virtual Machine, which can reduce stop-the-world times on machines with limited resources; this is an attempt to reduce response times related to GC activity.
However, it can result in fragmentation of the old generation, and can fall back to older methods. It is not efficient on large heaps, since the mark phase is dependent on the size of live objects, and the sweep phase can traverse the entire heap.
Under concurrent-mark-sweep, most garbage collection activity is performed concurrently, i.e., while the application threads are running, to keep garbage collection-induced pauses short. This is in contrast to a simple stop-the-world garbage collector which completely halts execution of the program to run a collection cycle.
To enable, use the JVM argument -XX:+UseConcMarkSweepGC
.
Resources
- CMS section of the hotspot GC tuning guide
- GC Options Cheatsheet