fast garbage collection without a long wait

13
Fast Garbage Collection without a Long Wait Steve Blackburn – Kathryn McKinley Presented by: Na Meng Ulterior Reference Counting:

Upload: bevan

Post on 23-Feb-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Ulterior Reference Counting:. Fast Garbage Collection without a Long Wait. Steve Blackburn – Kathryn McKinley Presented by: Na Meng. mutator. mutator. poor responsiveness. maximum pause. GC. CPU Utilization (  time  ). Throughput vs. Responsiveness. Goal - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Fast Garbage Collection without a Long Wait

Fast Garbage Collection without a Long Wait

Steve Blackburn – Kathryn McKinleyPresented by: Na Meng

Ulterior Reference Counting:

Page 2: Fast Garbage Collection without a Long Wait

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.

Page 3: Fast Garbage Collection without a Long Wait

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

Page 4: Fast Garbage Collection without a Long Wait

4

Basic Idea

Thanks to Curtis for his presentation recently.

Young nursery space

RC-mature space

1 2 0 1

Page 5: Fast Garbage Collection without a Long Wait

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

Page 6: Fast Garbage Collection without a Long Wait

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.

Page 7: Fast Garbage Collection without a Long Wait

7

Bounded Nursery

1 2

Situation: mature space is almost full

1 2

Will maximum pause time increase?Is this understanding correct?

Page 8: Fast Garbage Collection without a Long Wait

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

Page 9: Fast Garbage Collection without a Long Wait

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?

Page 10: Fast Garbage Collection without a Long Wait

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?

Page 11: Fast Garbage Collection without a Long Wait

11

Pause Time Control

Phases for Ulterior Garbage Collector Nursery Collection RC buffering RC collection Cycle collection

Bounded pause timeNegligibleUnbounded in worst caseUnbounded 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 ?

Page 12: Fast Garbage Collection without a Long Wait

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?

Page 13: Fast Garbage Collection without a Long Wait

www.themegallery.com