MMTk TutorialSteve Blackburn (Steve.Blackburn@anu.edu.au) Perry Cheng (perryche@us.ibm.com)Tutorial Expectations• Audience– GC Researchers– VM implementors looking for a memory mangementsystem Takeaway– An understanding of what MMTk is Flexible with high performance GC research infrastructure allowing fair comparisons– How to build/extend a garbage collector in MMTk Format– Interactive– Keep in mind the varying levels of expertise in audienceOutline Part 0: A review of GC (~10 minutes) Part 1: MMTk Overview (~10 minutes) Part 2: Structure of MMTk (~30 minutes) BREAK (15 minutes) Part 3: Demo: Writing a Collector (~1 hour) Q&A (15 minutes)What is Garbage Collection (GC)? Automatic Memory Management– Minimal programmer interface allocate deallocate– Optional application-level interface Heap size pause time GC hints, …– Avoid error-prone manual memory management Dangling pointers and resource leakage But not all memory leaks Increasingly popular because of runtime safety– Java, C#, Perl, Python, LISP, ML, Haskell, …– Even C/C++ (smart pointers, conservative collectors)How does GC work? Approximate liveness by reachability–Liveness→ Reachability–Unreachable → Dead (garbage)–Both deadness and unreachability are stable properties GC reclaims the space of unreachable objectsIdentifying Garbage Normal program execution– Allocate objects– Mutate edges GC triggers when space exhausted– Start ...