Reference: GC garbage collector classification
1. Garbage collection algorithm
1. Mark-sweep algorithm
2. Copy algorithm
3. Mark-sort algorithm
2. Classification according to the area where the garbage collector is located
1. New generation collector: Serial (copy algorithm), ParNew, Parallel Scavenge;
2. Old generation collectors: Serial Old (Mark-Order), Parallel Old, CMS (Mark-Clear) ;
3. The entire stack of collectors: G1 (marking-finishing) ;
Third, the garbage collector process
1.CMS collector
1) Initial mark
2) Concurrent marking
3) Remark
4) Concurrent clearance
2.G1
1) Initial mark
2) Concurrent marking
3) Final mark
4) (concurrent) screening and recycling