21
Task-aware Garbage Collection in a Multi- Tasking Virtual Machine Sunil Soman Laurent Daynès Chandra Krintz RACE Lab, UC Santa Barbara Sun Microsystems Labs

Task-aware Garbage Collection in a Multi-Tasking Virtual Machine Sunil Soman Laurent Daynès Chandra Krintz RACE Lab, UC Santa Barbara Sun Microsystems

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Task-aware Garbage Collection in a Multi-Tasking Virtual

Machine

Sunil SomanLaurent DaynèsChandra Krintz

RACE Lab, UC Santa BarbaraSun Microsystems Labs

2

Outline

Introduction MVM overview Task-aware collection

Performance isolation Fast, immediate resource reclamation Independent allocation & young gen

collection Evaluation Conclusion

3

Introduction

Multi-tasking VMs Multiple users/applications Improved startup Reuse & sharing Performance isolation Accounting & timely resource reclamation

Sharing/performance isolation conflict Loss of scalability Bottleneck: memory management system

4

MVM overview

Multiple isolated instances in same VM Implements Isolates API (JSR 121) Safety & isolation guaranteed

Task re-entrance Class sharing

Separate task-dependent parts, rest sharedAccessed thru table indexed by unique task id

Based on Hotspot VM Generational mark-compact GC

5

MVM Garbage Collection

Shared generational heap Scavenged young gen (eden & survivor

spaces) 4 phase mark-compact collected old

generation Card table for tracking mature to young

pointers

eden old permanentfrom toyoung

6

MVM Garbage Collection

Lack of “task awareness” Scalability & performance isolation Space occupied by dead tasks reclaimed

on GC Parameter virtualization

7

Task-aware collection

Performance isolation Hybrid heap layout Task-concurrent scavenging

Fast, immediate resource reclamation Without requiring full or partial GC

8

Hybrid heap layout

eden old permanenttofrom

eden from to

.

.

eden from to

Per-task

9

Hybrid heap layout: young gen

10

Hybrid heap layout: Old gen

Promotion Area Buffers Per-task old generation regions Allocated on demand Adjusted on full heap GC Used for scavenging & pretenuring

Provide Performance isolation GC-less reclamation on task termination Per-task card table scanning

Enabled due to precise accounting of old gen

11

Resource Reclamation

Allocation top

Free PABsTask 2

Allocation topAllocation top

Task 3Task 1

.

.

.

.

.

Allocation top

12

Task-concurrent Scavenging

Leverages hybrid heap design Mutators can execute during scavenge Concurrent old gen direct allocation Synchronization

Threads belonging to GC initiator stopped Threads poll on protected page Suspended on access fault Threads belonging to other tasks not

suspended

13

Evaluation

time

long app

short app …

Experimental setup Dual UltraSPARC 1.5GHz, Solaris 10 Dacapo & Spec98 benchmarks

Throughput & Response time # short apps & average pause time Hybrid heap layout vs Shared heap

14

Results: Thruput & resp. time

0

5

10

15

20

25

30

jess jack ps Average

Long running program

Th

rup

ut

imp

rove

men

t (%

)

12

# short program instances

Short (javac w/small input) + long running program (jess, jack, ps)

0

5

10

15

20

25

30

jess jack ps Average

Long running program

Re

s. t

ime

imp

rov

em

en

t (%

)

12

# short program instances

15

Evaluation

Concurrent execution performance Hybrid heap + task-conc. scavenging vs

shared Instances of same task run concurrently 1 thru 5 instances

GC time & # GCs End-to-end execution time

16

Concurrent Exec: GC Time

62% 54% 100%-50

-30

-10

10

30

50

70

jess

rayt

race db

mpeg

audio

jack ps

jyth

on

Avera

ge

GC

Tim

e im

pro

vem

ent

(%) 1 5432# homogenous instances

17

Concurrent Exec: Change in GCs

BmarkMinor Major Minor Major Minor Major Minor Major Minor Major

jess 9 -2 18 -3 26 -4 34 -4 42 -4

raytrace 5 -1 9 -2 76 -1 95 -2 155 -1

db 2 -1 25 0 57 -1 105 -1 136 -4

mpeg 0 0 0 0 0 0 0 0 0 0

jack 6 -9 11 -9 16 -15 80 -11 26 -11

ps 14 0 25 -1 36 -1 48 -1 58 -2jython 8 -1 16 -11 23 -15 31 -15 38 -16

Change in # GCs1 2 3 4 5

18

Concurrent Exec: Exec. Time

-10

-5

0

5

10

15

20

25

30T

ota

l Ex

ec

Tim

e im

pro

ve

me

nt

(%)

1 5432# homogenous instances

19

Related Work

Prior MVM Thread-local heaps [Domani ’02,

Steensgaard ’00] Isolation [Back ’05] Card table/remset opt [Azagury ’98,

Detlefs ’02]

20

Summary

Task-aware collection Performance isolation Immediate, GC-free reclamation Heap layout, mechanisms & perf.

evaluation Significantly improves overall execution,

throughput & response time

21

Future Work

Better multi-tasking workloads Old generation collection

Independent collection of PABs Different collection policies

Automatic performance tuning Per-application tuning of GC parameters

Global management