jvm virtual machine notes <two> garbage collection and memory allocation

Determines that the object has been abandoned in two steps:

  1. Use reachability analysis algorithm (with GC roots association - objects in the virtual machine stack, the method area static objects, methods, constants target area, the local method reference object ) to determine whether the need to recycle.
  2. Whether covering over finalize and execute the method: cover too can "from death once."

Garbage collection algorithm:

  • Mark - sweep algorithm: the labeled Clear.
  • Replication algorithm: the recovery of a copy of the mark, and other memory clear.
  • Mark - sorting algorithm: the finishing labeled Clear.
  • Generational collection algorithm: the new generation and the old sub-collection algorithm's choice - a small newborn survival using the copy on behalf of, the object's old high survival rate of 6 using mark - sweep (finishing).

 

Guess you like

Origin www.cnblogs.com/lvoooop/p/11945691.html
Recommended