Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Garbage Collection. GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing.

Similar presentations


Presentation on theme: "Introduction to Garbage Collection. GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing."— Presentation transcript:

1 Introduction to Garbage Collection

2 GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing (implicit) Reference Counting (explicit) Sweep-to-Free Compact Evacuate 31

3 Mark-Compact [Styger 1967] Bump allocation + trace + compact GC Fundamentals Canonical Garbage Collectors 3 ` Sweep-to-Free Compact Evacuate Mark-Sweep [McCarthy 1960] Free-list + trace + sweep-to-free Semi-Space [Cheney 1970] Bump allocation + trace + evacuate

4 GC Fundamentals The Time–Space Tradeoff 4

5 Mark-Sweep (Free List Allocation + Trace + Sweep-to-Free) 5 ✓ ✓ Space efficient ✓ ✓ Simple, very fast collection Poor locality

6 Mark-Compact (Bump Allocation + Trace + Compact) 6 ✓ ✓ Good locality Good locality ✓ ✓ Space efficient Expensive multi-pass collection

7 Semi-Space (Bump Allocation + Trace + Evacuate) 7 ✓ ✓ Good locality Space inefficient

8 Sweep-To-Region and Mark-Region 8 ` Sweep-to-Free Compact Evacuate Reclamation Sweep-to-Region Mark-Sweep Free-list + trace + sweep-to-free Mark-Compact Bump allocation + trace + compact Semi-Space Bump allocation + trace + evacuate Mark-Region Bump alloc + trace + sweep-to-region

9 Mark-Region (Bump Allocation + Trace + Sweep-to-Region) 9 ✓ ✓ Simple, very fast collection ✓ ✓ Space efficient ✓ ✓ Good locality ✓ ✓ Excellent performance Excellent performance

10 Naïve Mark-Region 10 Contiguous allocation into regions Excellent locality – For simplicity, objects cannot span regions Simple mark phase (like mark-sweep) – Mark objects and their containing region Unmarked regions can be freed 0 0

11 Generational [Ungar 1984] Most objects die young 11 Nursery space Mature space

12 Immix [Blackburn and McKinley 2008] 0 0 Contiguous allocation into regions – 256B lines and 32KB blocks – Objects span lines but not blocks Simple mark phase – Mark objects and containing regions Free unmarked regions Recycled allocation and defragmentation 12 block line recyclable lines object markline mark


Download ppt "Introduction to Garbage Collection. GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing."

Similar presentations


Ads by Google