JVM Garbage collection

garbage-collection, java, jvm

Solution

The "throughput collector" which is enabled with `-XX:+UseParallelGC` and is the default collector uses multiple threads. The "concurrent low pause collector" enabled with `-XX:+UseConcMarkSweepGC` uses one thread for concurrent collector but its stop-the-world collections are parallel.

Only the rarely used single threaded gc `-XX:+UseSerialGC` is single threaded.

http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

Problem

In general ( as I am aware that there is a standard JVM implementation from Oracle/sun and other third parties as well like MS) , Does JVM create only one Garbage collection thread running as daemon to collect the garbage objects OR does JVM spawn more than one thread to accomplish the Garbage collection?

Original source