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
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 shared Accessed 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 edenoldpermanentfromtoyoung
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 edenoldpermanenttofrom 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 top Task 3Task 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 Short (javac w/small input) + long running program (jess, jack, ps)
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%
17 Concurrent Exec: Change in GCs
18 Concurrent Exec: Exec. Time
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