Fast Garbage Collection without a Long Wait Steve Blackburn – Kathryn McKinley Presented by: Na Meng Ulterior Reference Counting:
Throughput vs. Responsiveness Goal Better responsiveness (shorter pause time) Better throughput (running time) GC mutator CPU Utilization ( time ) mutatorpoor responsiveness maximum pause 2 Thanks to Dimitris for his presentation in 2009.
Copying GC time proportional to survivors Ideal for collecting high mortality young objects Reference Counting GC time proportional to mutations Ideal for collecting objects with low mutation 3 Young objects High mortality High mutation Old objects Low mortality Low mutation Ulterior Reference Counting
Basic Idea 4 Thanks to Curtis for his presentation recently. Young nursery space RC-mature space
Ulterior Reference Counting 5 Non-RC to RC Expensive RC tracking Expensive cycle detection Cyclic structures Pause time Old-new pointer Cycle detection Bounded nursery RC buffering Integrate Write Barrier Parameter Control
Cycle Detection Root Buffer Live Data Process Decrements 2. Mark Gray 3. Scan 4. Collect White Cycle Buffer 5. Calculate external in-degree If 0, GC/decrement neighbors 7. If non-0, restore Modified from David Bacon’s slide in 2001.
Bounded Nursery Situation: mature space is almost full 1 2 Will maximum pause time increase? Is this understanding correct?
RC Buffering 8 Stacks Registers Boot Image & Immortal 1 a 1 c 1 e 1 d 1 f 1 b Situation: tracking RC is expensive Inc Buffer Dec Buffer a c 2 c 0 a
Integration 9 Boot Image & Immortal 1 b Stacks Registers 0 c d d e e f f g g When doing nursery collection Boot Image & Immortal 1 b Stacks Registers 0 c 0 d 0 e 0 g 0 f Inc Buffer ged f Decrease d in the next collection to make the increment temporary. Why?
Write Barrier 10 Boot Image & Immortal 1 b Stacks Registers 2 c d d e e srcObjsrcSlottgtobj Modified Object Set Dec Buffer b&bd c b e Prepare for nursery collection What will happen if b points back to c again?
Pause Time Control 11 Phases for Ulterior Garbage Collector Nursery Collection RC buffering RC collection Cycle collection Bounded pause time Negligible Unbounded in worst case To control RC collection time Limit size of modified object buffer, dec buffer To control cycle collection time Limit time spent on this work Why not limit inc buffer size ?
Discussion Cycle detection On every RC collection, create a candidate set of potential cycle roots from all the decrements which do not go to zero Cycle detection starts from the candidate set Do we need a limit to the length of candidate set? Do such decrements guarantee finding all cycles if time allows? 12