7 kinds of garbage collectors in the Java virtual machine

7 garbage collectors in HotSpot VM: Serial, ParNew, Parallel Scavenge, Serial Old, Parallel Old, CMS, G1

1, Serial New/Serial Old (serial)

The Serial New/Serial Old collector is the most basic and oldest collector. It is a single-threaded collector, and when it performs a garbage collector, it must suspend all user threads used. The Serial New collector is a collector for the new generation. , using the Copying algorithm, the Serial Old collector is a collector for the old age, using the Mark-Compact algorithm, which has the advantage of being simple to implement, but the disadvantage is that it will bring pauses to users.

2. Parallel New (parallel)

The collector is a multithreaded version of the Serial collector

3,Parrallel Scavenge

The Parrallel Scavenge collector is a new-generation multi-threaded collector (parallel collector), which does not need to suspend other user threads during recycling. It adopts the Copying algorithm, which is different from the previous two algorithms. It is mainly for achieve a manageable throughput

4,Parrallel Old

Parrallel Old is the old version of Parrallel Scavenge, using multithreading and Mark-Compact algorithm

5,CMS

The CMS collector is a collector whose goal is to obtain the shortest recovery pause time. It is a concurrent collector and uses the Mark-sweep algorithm.

6 , G1

The G1 collector is the most cutting-edge achievement of collector technology today. It is a server-side application collector. It can make full use of multi-core CPU and multi-core environment, so it is a parallel and concurrent collector, and can build predictable The pause time model of the

reference link

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326756457&siteId=291194637