Garbage Collector

Generational Garbage Collection

The use of multiple spaces makes garbage collection even more efficient because blocks that stay reachable for a long time can migrate to spaces that are garbage collected less often, while in frequently collected spaces, only a small fraction of the blocks are still reachable by the time of a collection, making those collections fast. This division of spaces into old, rarely collected ones and young, frequently collected ones is called generational garbage collection.