1 / 19

Immix: A Mark-Region Garbage Collector

Immix: A Mark-Region Garbage Collector. Jennifer Sartor CS395T Presentation Mar 2, 2009. Contributions. Another family of collectors: Mark-Region Immix has all of: space e fficiency, fast c ollection, and m utator performance Bump allocation Locality

grover
Télécharger la présentation

Immix: A Mark-Region Garbage Collector

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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.

  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.

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

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

  5. Sweep-To-Regionand Mark-Region Reclamation Sweep-to-Free Mark-Sweep Free-list + trace + sweep-to-free ` Compact Mark-Compact Bump allocation + trace + compact Evacuate Semi-Space Bump allocation + trace + evacuate Mark-Region Bump alloc + trace + sweep-to-region Sweep-to-Region Thanks to Steve for his Immix presentation from 2008.

  6. Compared to Existing Collectors Thanks to Steve for his Immix presentation from 2008.

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

  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.

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

  10. Allocation Policy(Recycling) • 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? Thanks to Steve for his Immix presentation from 2008.

  11. Opportunistic Defragmentation • 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) 0 • Source = most holes • Other heuristics? Thanks to Steve for his Immix presentation from 2008.

  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.

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

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

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

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

  17. Discussion • Compare to Beltway! • Increments & belts vs. lines & blocks • Both: reduce space util, good locality • Differences: incrementality and copying • Compare to MC2 • 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.

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

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

More Related