1. objects that can be recycled.
2. When to recycle these objects.
3. What kind of recovery is used.
GC policy Algorithm
Reference Counting Algorithm. However, this algorithm has a fatal defect, that is, it cannot recycle referenced objects in a loop. Imagine that if JVM adopts this GC policy, the following code should not be expected to appear again when the program is compiled.
= = Thread( = = Object(); objectA.field == objectA; objectA = = ; (
Root Search Algorithm. The processing method is,A number of root objects are set up. When a root object fails to reach a certain object, the object can be recycled..
1. The referenced object in the VM stack.
2. Objects referenced by class static attributes in the method area.
3. Objects referenced by constants in the method area.
4. Objects referenced by JNI in the local method stack.
Mark-clear algorithm, copy algorithm, and Mark-Sort Algorithm.