Taskaware Garbage Collection in a MultiTasking Virtual Machine
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 w Introduction w MVM overview w Task-aware collection n Performance isolation Fast, immediate resource reclamation Independent allocation & young gen collection w Evaluation w Conclusion 2
Introduction w Multi-tasking VMs n n n Multiple users/applications Improved startup Reuse & sharing Performance isolation Accounting & timely resource reclamation w Sharing/performance isolation conflict n n Loss of scalability Bottleneck: memory management system 3
MVM overview w Multiple isolated instances in same VM n n Implements Isolates API (JSR 121) Safety & isolation guaranteed w Task re-entrance n Class sharing Separate task-dependent parts, rest shared l Accessed thru table indexed by unique task id l w Based on Hotspot VM n Generational mark-compact GC 4
MVM Garbage Collection eden young from to old permanent w Shared generational heap n n n Scavenged young gen (eden & survivor spaces) 4 phase mark-compact collected old generation Card table for tracking mature to young pointers 5
MVM Garbage Collection w Lack of “task awareness” n n n Scalability & performance isolation Space occupied by dead tasks reclaimed on GC Parameter virtualization 6
Task-aware collection w Performance isolation n n Hybrid heap layout Task-concurrent scavenging w Fast, immediate resource reclamation n Without requiring full or partial GC 7
Hybrid heap layout eden from to. . eden old permanent Per-task from to 8
Hybrid heap layout: young gen 9
Hybrid heap layout: Old gen w Promotion Area Buffers n n Per-task old generation regions Allocated on demand Adjusted on full heap GC Used for scavenging & pretenuring w Provide n n n Performance isolation GC-less reclamation on task termination Per-task card table scanning l Enabled due to precise accounting of old gen 10
Resource Reclamation Task 1 Task 2 Task 3 Free PABs . . . Allocation top 11
Task-concurrent Scavenging w Leverages hybrid heap design w Mutators can execute during scavenge w Concurrent old gen direct allocation w Synchronization n n Threads belonging to GC initiator stopped Threads poll on protected page Suspended on access fault Threads belonging to other tasks not suspended 12
Evaluation w Experimental setup n n Dual Ultra. SPARC 1. 5 GHz, Solaris 10 Dacapo & Spec 98 benchmarks long app short app … time w Throughput & Response time n n # short apps & average pause time Hybrid heap layout vs Shared heap 13
Results: Thruput & resp. time Short (javac w/small input) + long running program (jess, jack, ps) 14
Evaluation w Concurrent execution performance n n n Hybrid heap + task-conc. scavenging vs shared Instances of same task run concurrently 1 thru 5 instances w GC time & # GCs w End-to-end execution time 15
Concurrent Exec: GC Time 62% 54% 100% 16
Concurrent Exec: Change in GCs 17
Concurrent Exec: Exec. Time 18
Related Work w Prior MVM w Thread-local heaps [Domani ’ 02, Steensgaard ’ 00] w Isolation [Back ’ 05] w Card table/remset opt [Azagury ’ 98, Detlefs ’ 02] 19
Summary w Task-aware collection n n Performance isolation Immediate, GC-free reclamation Heap layout, mechanisms & perf. evaluation Significantly improves overall execution, throughput & response time 20
Future Work w Better multi-tasking workloads w Old generation collection n n Independent collection of PABs Different collection policies w Automatic performance tuning n Per-application tuning of GC parameters w Global management 21
- Slides: 21