Ulterior Reference Counting: Fast Garbage Collection without a Long Wait PowerPoint PPT Presentation

presentation player overlay
1 / 26
About This Presentation
Transcript and Presenter's Notes

Title: Ulterior Reference Counting: Fast Garbage Collection without a Long Wait


1
Ulterior Reference CountingFast Garbage
Collection without a Long Wait
  • Author Stephen M Blackburn
  • Kathryn S McKinley
  • Presenter Jun Tao

2
Outline
  • Introduction
  • Background
  • Ulterior Reference Counting
  • Methodology
  • Results
  • Conclusion

3
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

4
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

5
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

6
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

7
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

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

9
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

10
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

11
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

12
Ulterior Reference Counting
  • Generalizing Deferral

A RC integrate event RCI(p) changes a deferred
pointer to not-deferred is needed.
13
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

14
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

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

16
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

17
Ulterior Reference Counting
  • Write Barrier (continued)

18
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

19
Ulterior Reference Counting
  • Cycle Detection
  • Bacon and Rajans 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 RC0 are cyclic garbage
  • The authors choice
  • Perform cycle detection with increasing
    probability when the available heap space falls
    toward a user-defined limit

20
Methodology
  • Jikes RVM and JMTk
  • Collectors
  • RC coalescing, deferred
  • BG-RC
  • MS
  • BG-MS bounded copying nursery MS mature space

21
Results
22
Results
23
Results
24
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 gt BG-MS gt BG-RC

25
Results
BG-RC Sensitivity to Variations in Collection
Triggers (defaults are 4MB nursery, 60ms time
cap, and 512KB cycle trigger)
26
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
Write a Comment
User Comments (0)
About PowerShow.com