Copying Garbage Collection
Guido Tack
- 14. November 2001
tack@ps.uni-sb.de
Copying Garbage Collection Guido Tack 14. November 2001 - - PowerPoint PPT Presentation
Copying Garbage Collection Guido Tack 14. November 2001 tack@ps.uni-sb.de 1 The idea of Copying GC Two semi-spaces ( From -space and To -space) Only From-space active At GC time, copy the live nodes from From-Space to
tack@ps.uni-sb.de
A D E F G C B
From To
To
B’ C’ A’ D’ E’ F’ G’ A D E F G C B
From
Tricolour abstraction:
GC terminates when all reachable nodes are black
Tricolour abstraction:
GC terminates when all reachable nodes are black
Tricolour abstraction:
GC terminates when all reachable nodes are black
Tricolour abstraction:
GC terminates when all reachable nodes are black
Tricolour abstraction:
GC terminates when all reachable nodes are black
Tricolour abstraction:
GC terminates when all reachable nodes are black
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’
scan free
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’
free scan
A D E F G C B
From To
A’ A’ B’ B’ C’ C’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
scan free
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
free scan
A D E F G C B
From To
A’ B’ B’ C’ C’ A’ D’ D’ E’ E’ F’ F’ G’ G’
free scan
High Level
Low Level
High Level
Low Level
High Level
Low Level
High Level
Low Level
High Level
Low Level
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
(possibly handled by different collector)
(only scanned, not copied)
(but then stack becomes an issue)
Approximately depth-first copying(1) Modification of Cheney’s agorithm by Moon (1984)
scan partial free
Approximately depth-first copying(1) Modification of Cheney’s agorithm by Moon (1984)
scan partial free
Approximately depth-first copying(1) Modification of Cheney’s agorithm by Moon (1984)
scan partial free
Approximately depth-first copying(1) Modification of Cheney’s agorithm by Moon (1984)
scan partial free
Approximately depth-first copying(1) Modification of Cheney’s agorithm by Moon (1984)
scan partial free
Approximately depth-first copying(2)
Approximately depth-first copying(2)
Approximately depth-first copying(2)
Approximately depth-first copying(2)
⇒ More garbage
⇒ More garbage
⇒ More garbage
3 2 2 2 2 2
3 2 2 2 2 2
6 5 2
(alloc. is cheap)
(copying small objects not much more expensive than marking)
(alloc. is cheap)
(copying small objects not much more expensive than marking)
(alloc. is cheap)
(copying small objects not much more expensive than marking)
(alloc. is cheap)
(copying small objects not much more expensive than marking)
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.
(e.g. use copying only for small objects, mark-sweep for large
– incremental – generational GC algorithms.