2.28k likes | 2.31k Views
Incremental Garbage Collection. Uwe Kern 23. Januar 2002 kern@cs.uni-sb.de. Incremental GC. Mutator runs while collecting is performed Collecting is done in small, partial steps Drastically reduced pause times Extension of existing tracing GC's. A. B. Cells & GC state. C.
E N D
Incremental Garbage Collection Uwe Kern 23. Januar 2002 kern@cs.uni-sb.de
Incremental GC • Mutator runs while collecting is performed • Collecting is done in small, partial steps • Drastically reduced pause times • Extension of existing tracing GC's
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
A B Cells & GC state C completed found unvisited/garbage Problem: Intertwined mutation Root
Solution: Synchronization • Idea: • Intercept access to or modification of references in objects (barrier) • Do something in barrier to prevent race conditions
Example Barrier Which kind of mutations are fatal ? Reference to white object X written into one or more black objects. All references from white/grey objects to X deleted.
Example Barrier Which kind of mutations are fatal ? Reference to white object X written into one or more black objects. All references from white/grey objects toXdeleted. Idea: Eliminate black-white pointers by coloring black object grey again
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Example Barrier Root A B C
Incremental GC Properties • Collector sees conservative approximation of reachability graph
Incremental GC Properties • Collector sees conservative approximation of reachability graph • Conservatism leads to floating garbage
Incremental GC Properties • Collector sees conservative approximation of reachability graph • Conservatism leads to floating garbage • Strong approximations decrease incrementality
Quality Criterias • Conservatism: level of floating garbage produced
Quality Criterias • Conservatism: level of floating garbage produced • Incrementality: more fine-grained is better
Quality Criterias • Conservatism: level of floating garbage produced • Incrementality: more fine-grained is better • Mutator overhead: processor and memory costs
Concurrent Mark-Sweep • [Steele, 1975]
Concurrent Mark-Sweep • [Steele, 1975] • mutator and collector running parallel