Download presentation
Presentation is loading. Please wait.
Published byMoris Moody Modified over 8 years ago
1
Garbage Collecting the World Presentation: Mark Mastroieni Authors: Bernard Lang, Christian Queinne, Jose Piquer
2
Presentation Overview The Algorithm: Summary, Advantages The Algorithm: Summary, Advantages Terminology Defined Terminology Defined Details: How it Works Details: How it Works Conclusions Conclusions
3
Overview of the Algorithm This paper presents: a new distributed GC algorithm which This paper presents: a new distributed GC algorithm which (i) is fault-tolerant, (i) is fault-tolerant, (ii) is largely independent of how a processor garbage collects its own data space, (ii) is largely independent of how a processor garbage collects its own data space, (iii) does not need centralized control nor global stop-the-world synchronization, (iii) does not need centralized control nor global stop-the-world synchronization, (iv) allows for multiple concurrent active GCs, (iv) allows for multiple concurrent active GCs, (v) does not require migrating objects from processor to processor and (v) does not require migrating objects from processor to processor and (vi) eventually reclaims all inaccessible objects including distributed cycles. (vi) eventually reclaims all inaccessible objects including distributed cycles.
4
How It’s Different The main idea: The main idea: –What sets this Garbage Collection (GC) algorithm apart from others is the concept of groups –Processes/Processors are organized into dynamic groups of varying sizes –Each group has its own global Garbage Collector –Each process has its own local GC as well
5
How Groups Work Group GCs discover and reclaim all unreachable distributed cycles of objects in the group. Group GCs discover and reclaim all unreachable distributed cycles of objects in the group. Multiple overlapping group GCs can be simultaneously active. Multiple overlapping group GCs can be simultaneously active. When a processor or a communication link fails to cooperate, the groups within which it lies are reorganized and continue their work. When a processor or a communication link fails to cooperate, the groups within which it lies are reorganized and continue their work. Eventually all distributed clusters of unreachable objects will belong to a group that reclaims these clusters when it finishes its associated GC. Eventually all distributed clusters of unreachable objects will belong to a group that reclaims these clusters when it finishes its associated GC.
6
Advantages Multiple active GCs can detect more dead loops Multiple active GCs can detect more dead loops Allows for failure of nodes (dynamic changes in groups) Allows for failure of nodes (dynamic changes in groups) Needs no centralized control Needs no centralized control Works with almost any kind of (pre- existing) local GC Works with almost any kind of (pre- existing) local GC
7
Standard GC Terminology Nodes are processes able to manage their own memory space Nodes are processes able to manage their own memory space Cells are chunks of memory in nodes, which may contain references to cells in the same or other nodes Cells are chunks of memory in nodes, which may contain references to cells in the same or other nodes Roots are all nodes known by a mutator (e.g. in registers or in an execution stack) Roots are all nodes known by a mutator (e.g. in registers or in an execution stack) Cells reachable from a root are live, else they’re dead Cells reachable from a root are live, else they’re dead
8
New Terminology Specific Terms: Specific Terms: A remote reference to a cell y is represented by a reference to an exit item on the same node, which references an entry item on another node, which itself references locally the cell y (see next slide). A remote reference to a cell y is represented by a reference to an exit item on the same node, which references an entry item on another node, which itself references locally the cell y (see next slide).
9
Exit/Entry Items y Node P Node Q entry item exit item references cell y
10
Basic Algorithm (Single Group) – Initialization 1. group negotiation: A node finds/joins a group (solely for the group GC). 1. group negotiation: A node finds/joins a group (solely for the group GC). 2. initial marking: All the entry items of nodes within the group are marked w.r.t. the group – are they referenced from inside or outside the group? 2. initial marking: All the entry items of nodes within the group are marked w.r.t. the group – are they referenced from inside or outside the group? 3. local propagation: Local GCs propagate the marks of the entry items towards the exit items. 3. local propagation: Local GCs propagate the marks of the entry items towards the exit items. 4. global propagation: The group GC propagates the marks of the exit items towards the entry items they reference, when within the group. 4. global propagation: The group GC propagates the marks of the exit items towards the entry items they reference, when within the group.
11
Basic Algorithm – Finalization 5. stabilization: The preceding two steps are repeated until marks of entry or exit items of the group no longer evolve. 5. stabilization: The preceding two steps are repeated until marks of entry or exit items of the group no longer evolve. 6. dead cycles removal: The group GC breaks the unreachable cycles in the group. 6. dead cycles removal: The group GC breaks the unreachable cycles in the group. 7. group disbanding: The work is now finished and the group may be disbanded. 7. group disbanding: The work is now finished and the group may be disbanded.
12
Details – Marking Items The algorithm works by giving each entry/exit item a mark: marks are either hard or soft. The algorithm works by giving each entry/exit item a mark: marks are either hard or soft. After stabilization, all entry items in the group are marked: After stabilization, all entry items in the group are marked: –hard whenever they are reachable from a cell outside the group or from a root belonging to the group. –soft only if they’re part of inaccessible cycles local to the group and can thus be safely reclaimed.
13
Taking Out the Trash… Our algorithm simply modifies soft entry items to reference null… Our algorithm simply modifies soft entry items to reference null… …and lets the local GC go to work! …and lets the local GC go to work! Actual reclamation of resources is delayed – but has the advantage of implementation-independence. Actual reclamation of resources is delayed – but has the advantage of implementation-independence.
14
…For Local GC to Pick Up Each node in the group modifies its soft entry items to now reference nil rather than a local cell. Each node in the group modifies its soft entry items to now reference nil rather than a local cell. The former offspring of these entry items, not otherwise accessible, will be reclaimed by the next local GC. The former offspring of these entry items, not otherwise accessible, will be reclaimed by the next local GC. Similarly the exit items that were kept alive exclusively by these entries will be reclaimed by the next local GC. Similarly the exit items that were kept alive exclusively by these entries will be reclaimed by the next local GC. The reclamation of such an exit item causes the sending of a decrement message to the entry item it references. The entry item’s reference counter decreases to 0 and it is reclaimed by the normal reference counting mechanism. The reclamation of such an exit item causes the sending of a decrement message to the entry item it references. The entry item’s reference counter decreases to 0 and it is reclaimed by the normal reference counting mechanism.
15
Aftermath Groups can be disbanded, or optionally kept around for future use. Groups can be disbanded, or optionally kept around for future use. If a node fails during GC, most often the group is simply reorganized into one or more new groups, and the algorithm starts over. If a node fails during GC, most often the group is simply reorganized into one or more new groups, and the algorithm starts over.
16
Global View Several group GCs take place simultaneously, and a local GC on a node can contribute to several of them. Several group GCs take place simultaneously, and a local GC on a node can contribute to several of them. Entry and exit items can then be common to all group GCs, though they must keep separate marks for each group. Entry and exit items can then be common to all group GCs, though they must keep separate marks for each group. However, overlap slows down the process, since both groups are relying on the one local GC to propagate their marks, etc. However, overlap slows down the process, since both groups are relying on the one local GC to propagate their marks, etc.
17
Conclusions Does what it claims: Does what it claims: –Cleans all garbage eventually –Tolerates failures –Low overhead (relies on local GCs, etc.) Very scalable (due to hierarchical structure, lack of centralized control) Very scalable (due to hierarchical structure, lack of centralized control) Sidebar: Paper leaves a number of options open for actual implementation Sidebar: Paper leaves a number of options open for actual implementation
18
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.