task-aware garbage collection in a multi-tasking virtual machine

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

Upload: bess

Post on 13-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

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. Outline. Introduction MVM overview Task-aware collection Performance isolation Fast, immediate resource reclamation - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

Task-aware Garbage Collection in a Multi-Tasking Virtual

Machine

Sunil SomanLaurent DaynèsChandra Krintz

RACE Lab, UC Santa BarbaraSun Microsystems Labs

Page 2: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

2

Outline

Introduction MVM overview Task-aware collection

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

collection Evaluation Conclusion

Page 3: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 4: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 5: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 6: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

6

MVM Garbage Collection

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

on GC Parameter virtualization

Page 7: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

7

Task-aware collection

Performance isolation Hybrid heap layout Task-concurrent scavenging

Fast, immediate resource reclamation Without requiring full or partial GC

Page 8: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

8

Hybrid heap layout

eden old permanenttofrom

eden from to

.

.

eden from to

Per-task

Page 9: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

9

Hybrid heap layout: young gen

Page 10: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 11: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

11

Resource Reclamation

Allocation top

Free PABsTask 2

Allocation topAllocation top

Task 3Task 1

.

.

.

.

.

Allocation top

Page 12: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 13: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 14: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 15: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 16: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 17: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 18: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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

Page 19: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

19

Related Work

Prior MVM Thread-local heaps [Domani ’02,

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

Detlefs ’02]

Page 20: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

20

Summary

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

evaluation Significantly improves overall execution,

throughput & response time

Page 21: Task-aware Garbage Collection in a Multi-Tasking Virtual Machine

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