210 likes | 386 Views
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
E N D
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 • Independent allocation & young gen collection • Evaluation • Conclusion
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
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 shared • Accessed thru table indexed by unique task id • Based on Hotspot VM • Generational mark-compact GC
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 young from to old permanent
MVM Garbage Collection • Lack of “task awareness” • Scalability & performance isolation • Space occupied by dead tasks reclaimed on GC • Parameter virtualization
Task-aware collection • Performance isolation • Hybrid heap layout • Task-concurrent scavenging • Fast, immediate resource reclamation • Without requiring full or partial GC
Hybrid heap layout eden from to old permanent eden to from Per-task . . eden to from
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
Task 3 Allocation top Allocation top Allocation top Allocation top Resource Reclamation Task 1 Task 2 Free PABs . . . . .
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
Evaluation • Experimental setup • Dual UltraSPARC 1.5GHz, Solaris 10 • Dacapo & Spec98 benchmarks long app short app … time • Throughput & Response time • # short apps & average pause time • Hybrid heap layout vs Shared heap
Results: Thruput & resp. time Short (javac w/small input) + long running program (jess, jack, ps)
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
Concurrent Exec: GC Time 62% 54% 100%
Related Work • Prior MVM • Thread-local heaps [Domani ’02, Steensgaard ’00] • Isolation [Back ’05] • Card table/remset opt [Azagury ’98, Detlefs ’02]
Summary • Task-aware collection • Performance isolation • Immediate, GC-free reclamation • Heap layout, mechanisms & perf. evaluation • Significantly improves overall execution, throughput & response time
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