What is the Parallel Garbage collector (-XX:+UseParallelGC)?
The new parallel garbage collector is similar to the young generation collector in the default garbage collector but uses multiple threads to do the collection. By default on a host with N CPUs, the parallel garbage collector uses N garbage collector threads in the collection. The number of garbage collector threads can be controlled with a command line option (see below). On a host with a single CPU the default garbage collector is used even if the parallel garbage collector has been requested. On a host with 2 cpus the Parallel garbage collector generally performs as well as the default garbage collector and a reduction in the young generation garbage collector pause times can be expected on hosts with more than 2 cpus. This new parallel garbage collector can be enabled by using command line product flag -XX:+UseParallelGC. The number of garbage collector threads can be controlled with the ParallelGCThreads command line option (-XX:ParallelGCThreads=
Related Questions
- The parallel collectors seem to use as many garbage collector (GC) threads as there are processors on the machine. How can I ask for more or fewer GC threads?
- How many times may an objects finalize() method be invoked by the garbage collector?
- What is the Parallel Garbage collector (-XX:+UseParallelGC)?