fast garbage collection without a long wait steve blackburn – kathryn mckinley presented by: na...
Post on 20-Jan-2016
216 Views
Preview:
TRANSCRIPT
Fast Garbage Collection without a Long Wait
Steve Blackburn – Kathryn McKinleyPresented by: Na Meng
Ulterior Reference Counting:
2
Throughput vs. Responsiveness
Goal Better responsiveness (shorter pause
time) Better throughput (running time)
GCmutator
CPU Utilization (time)
mutator poor responsiveness maximum pause
Thanks to Dimitris for his presentation in 2009.
3
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
Young objects High mortality High mutation
Old objects Low mortality Low mutation
Ulterior Reference Counting
4
Basic Idea
Thanks to Curtis for his presentation recently.
Young nursery space
RC-mature space
1
2 0
1
5
Ulterior Reference Counting
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
6
Cycle Detection
2
2 3
22
Root Buffer
LiveData
1 1 1
1. Process Decrements
2. Mark Gray
3. Scan
4. Collect White
11
21
10
1110
10
10
10
10
Cycle Buffer
5. Calculate external in-degree
3231303030
11
3332
1010
32
111010
6. If 0, GC/decrement neighbors
7. If non-0, restore
212
1
2
1 0
Modified from David Bacon’s slide in 2001.
7
Bounded Nursery
1
2
Situation: mature space is almost full
1
2
Will maximum pause time increase?Is this understanding correct?
8
RC Buffering
Stacks Registers
Boot Image & Immortal
1 a 1 c 1 e1 d 1 f1 b
Situation: tracking RC is expensive
Inc Buffer Dec Buffer
ac
2 c0 a
9
Integration
Boot Image & Immortal
1 b
Stacks Registers
0c d e f g
When doing nursery collection
Boot Image & Immortal
1 b
Stacks Registers
0c 0d 0e 0g0f
Inc Buffer
g edf
Decrease d in the next collection to make the increment temporary. Why?
10
Write Barrier
Boot Image & Immortal
1 b
Stacks Registers
2c d e
srcObj srcSlot tgtobj
Modified Object Set Dec Buffer
b &b d
c
b &b e
Prepare for nursery collection
What will happen if b points back to c again?
11
Pause Time Control
Phases for Ulterior Garbage Collector Nursery Collection RC buffering RC collection Cycle collection
Bounded pause time
Negligible
Unbounded in worst case
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 ?
12
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?
www.themegallery.com
top related