Presentation is loading. Please wait.

Presentation is loading. Please wait.

Immix: A Mark-Region Garbage Collector Jennifer Sartor CS395T Presentation Mar 2, 2009 Thanks to Steve for his Immix presentation from

Similar presentations


Presentation on theme: "Immix: A Mark-Region Garbage Collector Jennifer Sartor CS395T Presentation Mar 2, 2009 Thanks to Steve for his Immix presentation from"— Presentation transcript:

1 Immix: A Mark-Region Garbage Collector Jennifer Sartor CS395T Presentation Mar 2, 2009 Thanks to Steve for his Immix presentation from 2008. 1

2 Contributions Another family of collectors: Mark-Region Immix has all of: space efficiency, fast collection, and mutator performance – Bump allocation – Locality – Opportunistic defragmentation, mark+copy in single pass Thanks to Steve for his Immix presentation from 2008. 2

3 GC Fundamentals Algorithmic Components AllocationReclamation Thanks to Steve for his Immix presentation from 2008. 3 Identification Bump Allocation Free List ` Tracing (implicit) Reference Counting (explicit) Sweep-to-Free Compact Evacuate 31

4 Mark-Compact [Styger 1967] Bump allocation + trace + compact GC Fundamentals Canonical Garbage Collectors Thanks to Steve for his Immix presentation from 2008. 4 ` Sweep-to-Free Compact Evacuate Mark-Sweep [McCarthy 1960] Free-list + trace + sweep-to-free Semi-Space [Cheney 1970] Bump allocation + trace + evacuate

5 Sweep-To-Region and Mark-Region Thanks to Steve for his Immix presentation from 2008. 5 ` 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

6 Compared to Existing Collectors CollectorSpace Efficiency Fast Collection Mutator Performance Reclamation Mark- Sweep XXSweep-to- free Semi- Space XXEvacuation Mark- Compact XXCompaction Mark- Region XXXSweep-to- region Thanks to Steve for his Immix presentation from 2008. 6

7 Naïve Mark-Region Thanks to Steve for his Immix presentation from 2008. 7 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

8 Heap Organization Blocks – Recyclable – Immix block = 32KB Lines – Objects can span lines – Immix line = 128B Opportunistic defragmentation – Candidate and target blocks – Single pass to mark and copy Thanks to Steve for his Immix presentation from 2008. 8

9 Immix: Lines and Blocks Thanks to Steve for his Immix presentation from 2008. 9 Small Regions Large Regions ✗ Fragmentation (can’t fill blocks) ✓ More contiguous allocation ✗ Fragmentation (false marking) Lines & Blocks N pagesapprox 1 cache line ✓ Less fragmentation  Objects span lines ✓ Fast common case  Lines marked with objects ✗ Increased metadata o/h ✗ Constrained object sizes 0 0  TLB locality, cache locality  Block > 4 X max object size Free Recyclable

10 Allocation Policy (Recycling) Thanks to Steve for his Immix presentation from 2008. 10 Recycle partially marked blocks first Minimize fragmentation Maximize sharing of freed blocks Recycle in address order – We explored other options Allocate into free blocks last Effect on locality and fragmentation?

11 Opportunistic Defragmentation Thanks to Steve for his Immix presentation from 2008. 11 0 0 Identify source and target blocks – (see paper for heuristics) Evacuate objects in source blocks – Allocate into target blocks Opportunistic – Leave in place if no space, or object pinned Opportunistically evacuate fragmented blocks – Lightweight, uses same allocation mechanism – No cost in common case (specialized GC) Source = most holes Other heuristics?

12 Details Parallelizable – Coarse sweeping – Defragmentation Demand-driven overflow allocations – Medium objects Metadata space overheads – For parallel synch: mark bytes (not bits) – Line and block mark, not just object mark – Defragmentation headroom – Overflow allocation block – Conservative line marking Thanks to Steve for his Immix presentation from 2008. 12

13 Other Optimizations Thanks to Steve for his Immix presentation from 2008. 13 Implicit Marking ✓ Most objects small  Small objects implicitly mark next line ✓ V. Fast common case  Large objects mark lines exactly Implicit line mark Line mark Overflow Allocation  Multi-line objects may skip many small holes  Overflow allocation (used on failure) ✓ Large objects uncommon ✓ V. effective solution ✓ ✓

14 Mark-Region: Immix (Bump Allocation + Trace + Sweep-to-Region) Thanks to Steve for his Immix presentation from 2008. 14 ✓ ✓ Simple, very fast collection ✓ ✓ Space efficient ✓ ✓ Good locality Actual data, taken from geomean of DaCapo, jvm98, and jbb2000 on 2.4GHz Core 2 Duo ✓ ✓ Excellent performance Excellent performance

15 Minimum Heap Thanks to Steve for his Immix presentation from 2008. 15

16 Sticky Performance Thanks to Steve for his Immix presentation from 2008. 16 Geomean of DaCapo, jvm98 and jbb2000 on 2.4GHz Core 2 Duo Benefits of Sticky?

17 Discussion Compare to Beltway! – Increments & belts vs. lines & blocks – Both: reduce space util, good locality – Differences: incrementality and copying Compare to MC 2 Caching/paging? – Do tuned line/block sizes work? What is missing in experimental results? Heap utilization? Thanks to Steve for his Immix presentation from 2008. 17

18 Immix Efficient Mark-Region Garbage Collection Thanks to Steve for his Immix presentation from 2008. 18

19 Total Performance Thanks to Steve for his Immix presentation from 2008. 19 Geomean of DaCapo, jvm98 and jbb2000 on 2.4GHz Core 2 Duo


Download ppt "Immix: A Mark-Region Garbage Collector Jennifer Sartor CS395T Presentation Mar 2, 2009 Thanks to Steve for his Immix presentation from"

Similar presentations


Ads by Google