Ulterior Reference Counting: Fast Garbage Collection without a Long Wait Author: Stephen M Blackburn Kathryn S McKinley Presenter: Jun Tao.

Slides:



Advertisements
Similar presentations
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Advertisements

Steve Blackburn Department of Computer Science Australian National University Perry Cheng TJ Watson Research Center IBM Research Kathryn McKinley Department.
1 Write Barrier Elision for Concurrent Garbage Collectors Martin T. Vechev Cambridge University David F. Bacon IBM T.J.Watson Research Center.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
Garbage Collection  records not reachable  reclaim to allow reuse  performed by runtime system (support programs linked with the compiled code) (support.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
Beltway: Getting Around Garbage Collection Gridlock Mrinal Deo CS395T Presentation March 2, Content borrowed from Jennifer Sartor & Kathryn McKinley.
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
Efficient Concurrent Mark-Sweep Cycle Collection Daniel Frampton, Stephen Blackburn, Luke Quinane and John Zigman (Pending submission) Presented by Jose.
MC 2 : High Performance GC for Memory-Constrained Environments N. Sachindran, E. Moss, E. Berger Ivan JibajaCS 395T *Some of the graphs are from presentation.
ParMarkSplit: A Parallel Mark- Split Garbage Collector Based on a Lock-Free Skip-List Nhan Nguyen Philippas Tsigas Håkan Sundell Distributed Computing.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
Using Prefetching to Improve Reference-Counting Garbage Collectors Harel Paz IBM Haifa Research Lab Erez Petrank Microsoft Research and Technion.
OOPSLA 2003 Mostly Concurrent Garbage Collection Revisited Katherine Barabash - IBM Haifa Research Lab. Israel Yoav Ossia - IBM Haifa Research Lab. Israel.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
© Richard Jones, Eric Jul, mmnet GC & MM Summer School, July A Rapid Introduction to Garbage Collection Richard Jones Computing Laboratory.
Generational Stack Collection And Profile driven Pretenuring Perry Cheng Robert Harper Peter Lee Presented By Moti Alperovitch
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
Compilation 2007 Garbage Collection Michael I. Schwartzbach BRICS, University of Aarhus.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University.
1 An Efficient On-the-Fly Cycle Collection Harel Paz, Erez Petrank - Technion, Israel David F. Bacon, V. T. Rajan - IBM T.J. Watson Research Center Elliot.
Garbage collection (& Midterm Topics) David Walker COS 320.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
Uniprocessor Garbage Collection Techniques Paul R. Wilson.
Reference Counters Associate a counter with each heap item Whenever a heap item is created, such as by a new or malloc instruction, initialize the counter.
Compiler Optimizations for Nondeferred Reference-Counting Garbage Collection Pramod G. Joisha Microsoft Research, Redmond.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
Garbage Collection Memory Management Garbage Collection –Language requirement –VM service –Performance issue in time and space.
A Parallel, Real-Time Garbage Collector Author: Perry Cheng, Guy E. Blelloch Presenter: Jun Tao.
1 Overview Assignment 6: hints  Living with a garbage collector Assignment 5: solution  Garbage collection.
SEG Advanced Software Design and Reengineering TOPIC L Garbage Collection Algorithms.
Flexible Reference-Counting-Based Hardware Acceleration for Garbage Collection José A. Joao * Onur Mutlu ‡ Yale N. Patt * * HPS Research Group University.
Exploiting Prolific Types for Memory Management and Optimizations By Yefim Shuf et al.
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center The Metronome: A Hard Real-time Garbage Collector.
Taking Off The Gloves With Reference Counting Immix
380C Lecture 17 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Why you need to care about workloads.
GC Algorithm inside.NET Luo Bingqiao 5/22/2009. Agenda 1. 经典基本垃圾回收算法 2.CLR 中垃圾回收算法介绍 3.SSCLI 中 Garbage Collection 源码分析.
Fast Conservative Garbage Collection Rifat Shahriyar Stephen M. Blackburn Australian National University Kathryn S. M cKinley Microsoft Research.
A Mostly Non-Copying Real-Time Collector with Low Overhead and Consistent Utilization David Bacon Perry Cheng (presenting) V.T. Rajan IBM T.J. Watson Research.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
Copyright (c) 2004 Borys Bradel Myths and Realities: The Performance Impact of Garbage Collection Paper: Stephen M. Blackburn, Perry Cheng, and Kathryn.
Computer Science Department Daniel Frampton, David F. Bacon, Perry Cheng, and David Grove Australian National University Canberra ACT, Australia
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
380C lecture 19 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Opportunity to improve data locality.
Fast Garbage Collection without a Long Wait Steve Blackburn – Kathryn McKinley Presented by: Na Meng Ulterior Reference Counting:
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
G ARBAGE C OLLECTION CSCE-531 Ankur Jain Neeraj Agrawal 1.
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center ControllingFragmentation and Space Consumption in the Metronome.
A REAL-TIME GARBAGE COLLECTOR WITH LOW OVERHEAD AND CONSISTENT UTILIZATION David F. Bacon, Perry Cheng, and V.T. Rajan IBM T.J. Watson Research Center.
Memory Management -Memory allocation -Garbage collection.
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
2/4/20161 GC16/3011 Functional Programming Lecture 20 Garbage Collection Techniques.
CS412/413 Introduction to Compilers and Translators April 21, 1999 Lecture 30: Garbage collection.
Reference Counting. Reference Counting vs. Tracing Advantages ✔ Immediate ✔ Object-local ✔ Overhead distributed ✔ Very simple Trivial implementation for.
An Efficient, Incremental, Automatic Garbage Collector P. Deutsch and D. Bobrow Ivan JibajaCS 395T.
Introduction to Garbage Collection. GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing.
Dynamic Compilation Vijay Janapa Reddi
Rifat Shahriyar Stephen M. Blackburn Australian National University
Concepts of programming languages
Cycle Tracing Chapter 4, pages , From: "Garbage Collection and the Case for High-level Low-level Programming," Daniel Frampton, Doctoral Dissertation,
Ulterior Reference Counting Fast GC Without The Wait
David F. Bacon, Perry Cheng, and V.T. Rajan
Strategies for automatic memory management
Memory Management Kathryn McKinley.
Beltway: Getting Around Garbage Collection Gridlock
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Reference Counting.
Reference Counting vs. Tracing
Presentation transcript:

Ulterior Reference Counting: Fast Garbage Collection without a Long Wait Author: Stephen M Blackburn Kathryn S McKinley Presenter: Jun Tao

Outline Introduction Background Ulterior Reference Counting Methodology Results Conclusion

Introduction A long-standing and unachieved goal for GC (garbage collector) – Short pause times – Excellent throughput Throughput and responsiveness of generational collector (BG-MS) and Reference counting

Introduction A new generational collector: Ulterior Reference Counting (URC) – Copying nursery – Reference counting mature space – Use a deferred reference counting – Divides the heap into logical partitions of RC and non- RC objects – Reference count only infrequently mutated fields – Defer the fields of highly mutated objects and enumerate them Trace the deferred pointers Use a write barrier to remember them

Introduction Object lifetime and mutation demographics combine well to fit that requirement – Young objects mutate frequently and die at a high rate Favor generational collection, with copying algorithm using fast contiguous allocations for the young objects – Old objects mutate infrequently and die at a slower rate Favor a space efficient free-list allocator and a reference counting algorithm

Introduction BG-RC: a hybrid generational collector – BG: bounded copying nursery – RC: Reference counts the mature space – Ignores nursery pointer mutations – For surviving nursery objects Enumerates live pointers during tracing Copies them to RC space Computes reference counts for the mature space Reclaims objects with no reference

Background Generational Collection – Use tracing to identify dead objects indirectly – Copying collector Copies all live objects into another space Works well when few objects survive Use bump-pointer allocation – Mark-sweep collector Marks live objects Frees all unmarked objects Uses free-list allocation Needs no copy reserve Poor memory utilization without compaction

Background Generational Collection – How to organize nursery collection Flexible-sized nursery Fixed-size nursery Bounded nursery

Background Reference Counting – Advantage The work of garbage detection is spread out over every mutation – Disadvantage Additional algorithms must reclaim cycles Tracking every pointer mutation is expensive

Background Reference Counting (continued) – Mechanisms Deferral – Examines certain heavily mutated pointers periodically – Deferral phase in which RCs are not correct – RC phase in which they are Buffering – Do not perform RC increments and decrements immediately – Buffer and process them in RC phase Coalescing – The periodicity of deferred RC implies that only the initial values and final values of pointer fields are relevant – Uses the differences to generate increments and decrements

Background Reference Counting (continued) – RC Formal Definitions Mutation event RCM(p) – i.e., RC(p before )--, RC(p after )++ – May be buffered or performed immediately Retain event RCR(p) Deferral – No mutation generates RCM(p) – Need a RCR(p) to preserve objects

Ulterior Reference Counting Generalizing Deferral A RC integrate event RCI(p) changes a deferred pointer to not-deferred is needed.

Ulterior Reference Counting Deferral policies – Determines for each pointer whether or not to perform mutation events – Three approaches to enumerates deferral set Trace Deferred Fields – Trace all live deferred fields just prior to every RC phase Record Mutated Deferred Fields Record Mutated Deferred Objects

Ulterior Reference Counting A Generational RC Hybrid Collector (BG-RC) – For young objects Bump-pointer allocation Copying collection – For old objects Free-list allocation Reference counting collection

Ulterior Reference Counting A Generational RC Hybrid Collector (BG-RC) (continued)

Ulterior Reference Counting A Generational RC Hybrid Collector (BG-RC) (continued) – Write Barrier Remembers pointers into the nursery from the non- nursery spaces An object remembering coalescing barrier

Ulterior Reference Counting – Write Barrier (continued)

Ulterior Reference Counting Controlling Pause Times – Pause time : Nursery collection time + reference counting time – Appropriate nursery size Large Small – Frequent collections – Diminishes the effect of coalescing in RC – Gives nursery objects less time to die – Bound the accumulation of RC work between collections Limit the growth of meta data – Modified object buffer – Decrement buffer

Ulterior Reference Counting Cycle Detection – Bacon and Rajan’s trial deletion algorithm Colors the objects from all decrements which do not go to zero purple and puts them on a list If a purple still non-zero at the end of a RC phase, computes the object and objects reachable from it gray and decrements their RCs All gray objects with RC=0 are cyclic garbage – The authors’ choice Perform cycle detection with increasing probability when the available heap space falls toward a user- defined limit

Methodology Jikes RVM and JMTk Collectors – RC: coalescing, deferred – BG-RC – MS – BG-MS: bounded copying nursery; MS mature space

Results

Sensitivity to Heap size – Generational collectors perform better on both GC time and mutator time Benefit from bump-pointers – As the heap size shrinks, BG-RC degrades more rapidly than BG-MS Pause time guidelines prevent it from reclaiming cyclic garbage promptly – Mutator time Performance: MS > BG-MS > BG-RC

Results BG-RC Sensitivity to Variations in Collection Triggers (defaults are 4MB nursery, 60ms time cap, and 512KB cycle trigger)

Conclusion Matches allocation and collection policies to the behaviors of older and younger objects – Copying collector on nursery – Reference Counting collector on mature space Achieves good performance on both throughput and responsiveness