"JVM garbage Collection algorithm"
1) Mark - Clear algorithm:
Mark stage: First, mark all objects starting from the root node, and not tagged as garbage objects (wrong?). )
Purge stage: Clears all unmarked objects
2) copy algorithm:
Divide the original memory space into two pieces, one at a time, and at garbage collection, copy the surviving objects in the memory being used into the unused block of memory, and then clear all the objects in the memory block that you are using.
3) Labeling - sorting algorithm:
Mark Stage: Marks all objects from the root node that are not marked as garbage objects, first through the root node
Finishing phase: Compresses all the surviving objects into a section of memory, then cleans up all the space on the boundary
Comparison of three algorithms:
Efficiency: copy > tag grooming > tag cleanup ( efficiency here is just a simple comparison of time complexity, not necessarily . )
Memory Utilization: Tag Grooming > labeling cleanup > replication
Memory Uniformity: copy = tag grooming > Mark Erase
JVM garbage Collection algorithm (tag-purge, copy, tag-organize)