1. Tag Cleanup algorithm:
It is divided into two stages: "Mark" and "clear". The tagging phase has been introduced in the article "Object is dead". This algorithm mainly has two deficiencies: first, the efficiency problem, "mark" and "clear" two process efficiency is not high, the second is the space problem, the mark after the purge will produce a large number of discontinuous memory fragmentation, too much memory fragmentation may cause later in the program to run the process of allocating large objects, Unable to find enough contiguous space and had to touch another garbage collection operation in advance.
2. Copying algorithms
3. Marker Finishing Algorithm
4. Generational collection algorithm: divides the memory into several blocks depending on the lifetime of the object. The Java heap is generally divided into the new generation and the old age. The new generation uses the copy algorithm, the old age uses the mark clears the algorithm.
Garbage collection Algorithm!