Young generation Collector
Serial collector
The serial collector uses the tag-copy garbage collection algorithm. The serial collector can only use one thread for garbage collection, and when garbage collection is done, all worker threads need to stop working, waiting for the garbage collection thread to finish before other threads can continue to work. In a single-core scenario, this collector is very simple and efficient because it reduces the cost of context switching for many threads.
Parnew Collector
The Parnew garbage collector is a multithreaded version of the serial collector, using the tag-copy garbage collection algorithm. Run multiple collection threads for garbage collection work. This can improve the efficiency of the garbage collection process. The Parnew collector has the same number of garbage collection threads open by default as the current machine, and in order to control the number of GC collection threads, the number of garbage collection threads can be controlled by parameter -xx:parallelgcthreads .
Parallel Scavenge Collector
Parallel Scavenge collector It uses the tag-copy garbage collection algorithm. Like Parnew, it also has a multi-threaded garbage collector.
Old age Collector
Serial Old Collector
The Serial old collector is a single-threaded garbage collector that uses the mark-and-organize algorithm.
Parallel Old Collector
Use the "mark-and-organize" algorithm. is the old version of the parallel scavenge collector.
CMS collector
Java Virtual Machine garbage collector