The left side of the diagram shows what happens in a healthy partial GC:
- Dead objects are marked. (shaded black in diagram)
- Live Eden objects move to the To space.
- Young enough objects in the From space move to the To space.
- Old enough objects in the From space move to the old generation.
The right side shows the heap after the partial GC is complete. Now Eden is empty, and the From and To spaces have traded roles.
Later, we will discuss what happens if there isn't enough room in the To space or in the old generation to accommodate the live objects that belong to them.
No comments:
Post a Comment