Memory Management/Cooperative GC

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Cooperative Collectors[edit | edit source]

Cooperative collectors are collectors that require the rest of the system to participate in the collector's operation, such as with reference counting. These collectors spread the bookkeeping effort throughout the system and don't require a separate mark or sweep phase. These separate GC phases often require the rest of the program to come to a complete stop temporarily, which can create intolerable pauses in program operation. Cooperative collectors don't have these pauses.

Naive Reference Counting[edit | edit source]

Delayed Reference Counting[edit | edit source]

Cycles[edit | edit source]