Motivation Problems Algorithms Exact vs. Conservative Conclusion
Basics of Garbage Collection
Merlin Laue
Universität zu Lübeck
- 9. November 2015
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
- 9. November 2015
1
Basics of Garbage Collection Merlin Laue Universitt zu Lbeck 9. - - PowerPoint PPT Presentation
Motivation Problems Algorithms Exact vs. Conservative Conclusion Basics of Garbage Collection Merlin Laue Universitt zu Lbeck 9. November 2015 Merlin Laue (Uni Lbeck) Basics of Garbage Collection 9. November 2015 1 Motivation
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Universität zu Lübeck
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
1
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1
2
3
4
5
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
2
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
3
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
4
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
5
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1 Memory Usage 2 Fragmentation 3 Determinism 4 Time Effiency Merlin Laue (Uni Lübeck) Basics of Garbage Collection
6
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
7
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
8
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
9
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
10
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1 Semi Space 2 Reference Counting 3 Mark and Sweep 4 Mark and Compact 5 Generational Merlin Laue (Uni Lübeck) Basics of Garbage Collection
11
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
12
Motivation Problems Algorithms Exact vs. Conservative Conclusion 1 Swaps both spaces 2 Traces all root referents and copies uncopied objects to the
3 Leaves forwarding pointers in the old object 4 Adjusts references to point towards the new adress. Merlin Laue (Uni Lübeck) Basics of Garbage Collection
13
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
14
Motivation Problems Algorithms Exact vs. Conservative Conclusion 1 Upon first allocation an entry in the free-list is created 2 The write barrier records increases and decreases of references 3 Afterwards the amount of references is only buffered in the
4 If the references of an object reach 0 then a bit in the free-list is
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
15
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
16
Motivation Problems Algorithms Exact vs. Conservative Conclusion 1 Stopping of the program and mutator activity 2 Marking of alive objects 3 Sweeping : Scanning the heap for unmarked objects and freeing
4 Resuming mutator activity when reaching the end of the heap Merlin Laue (Uni Lübeck) Basics of Garbage Collection
17
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
18
Motivation Problems Algorithms Exact vs. Conservative Conclusion 1 Marking of alive objects 2 Compute forwarding adresses 3 Update pointers for the referents 4 Relocation of objects Merlin Laue (Uni Lübeck) Basics of Garbage Collection
19
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1
Young (Nursery)
2
mature
3
Permanent
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
20
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1
Flexible - Expands and retracts with collection and allocation
2
Fixed - Fixed size which will never expand or retract
3
Bound - Uses upper and lower boundry
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
21
Motivation Problems Algorithms Exact vs. Conservative Conclusion Merlin Laue (Uni Lübeck) Basics of Garbage Collection
22
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
23
Motivation Problems Algorithms Exact vs. Conservative Conclusion
1
Pinning
2
Filtering
3
Excess retention
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
24
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
25
Motivation Problems Algorithms Exact vs. Conservative Conclusion
Merlin Laue (Uni Lübeck) Basics of Garbage Collection
26