Explore tens of thousands of sets crafted by our community.
Garbage Collection Algorithms
8
Flashcards
0/8
Generational Garbage Collection
Objects are segregated into generations based on their ages. Younger generations are collected more often, reducing the overhead of collecting long-lived objects.
Region-Based Garbage Collection
Memory is divided into regions, each of which can be collected independently. Objects are allocated to regions and collected when the region is reclaimed.
Tricolor Marking
Uses three colors to mark objects: white for objects not yet processed, grey for objects that are reachable but whose references haven't been checked, and black for objects that have been processed.
Concurrent Garbage Collection
Garbage collection is performed during the execution of a program, running concurrently with the application threads to minimize pause times.
Reference Counting
Each object has a count of the number of references to it. When the reference count drops to zero, the object is immediately collected.
Incremental Garbage Collection
This method breaks the garbage collection process into small parts to reduce system freezes. Each small part is executed at different times.
Copy Collection
The memory is divided into two equal-sized areas. Live objects are copied from one area to the other, then the original area is cleared at once.
Mark-and-Sweep
This algorithm works in two phases: First, it 'marks' objects that are reachable from the roots; then it 'sweeps' away the unmarked objects.
© Hypatia.Tech. 2024 All rights reserved.