U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University.

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Matthew Hertz, Yi Feng, & Emery Berger Department of Computer Science University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Steve Blackburn Department of Computer Science Australian National University Perry Cheng TJ Watson Research Center IBM Research Kathryn McKinley Department.
1 Write Barrier Elision for Concurrent Garbage Collectors Martin T. Vechev Cambridge University David F. Bacon IBM T.J.Watson Research Center.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Michael Bond Kathryn McKinley The University of Texas at Austin Presented by Na Meng Most of the slides are from Mike’s original talk. Many thanks go to.
CSC 213 – Large Scale Programming. Today’s Goals  Consider what new does & how Java works  What are traditional means of managing memory?  Why did.
Canisius College Department of Computer Science Canisius College University of Rochester Poor Richard's Memory Manager Tongxin Bai, Jonathan Bard, Stephen.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
1 Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught ACM SIGMETRICS, 2002.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 2007 Exterminator: Automatically Correcting Memory Errors with High Probability Gene.
Beltway: Getting Around Garbage Collection Gridlock Mrinal Deo CS395T Presentation March 2, Content borrowed from Jennifer Sartor & Kathryn McKinley.
Efficient Concurrent Mark-Sweep Cycle Collection Daniel Frampton, Stephen Blackburn, Luke Quinane and John Zigman (Pending submission) Presented by Jose.
MC 2 : High Performance GC for Memory-Constrained Environments N. Sachindran, E. Moss, E. Berger Ivan JibajaCS 395T *Some of the graphs are from presentation.
Free-Me: A Static Analysis for Individual Object Reclamation Samuel Z. Guyer Tufts University Kathryn S. McKinley University of Texas at Austin Daniel.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science CRAMM: Virtual Memory Support for Garbage-Collected Applications Ting Yang, Emery.
Operating Systems CMPSCI 377 Lecture 11: Memory Management
Multiprocessing Memory Management
Connectivity-Based Garbage Collection Presenter Feng Xian Author Martin Hirzel, et.al Published in OOPSLA’2003.
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
U NIVERSITY OF M ASSACHUSETTS Department of Computer Science Automatic Heap Sizing Ting Yang, Matthew Hertz Emery Berger, Eliot Moss University of Massachusetts.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Quantifying the Performance of Garbage Collection vs. Explicit Memory Management.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts, Amherst Operating Systems CMPSCI 377 Lecture.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Garbage Collection Memory Management Garbage Collection –Language requirement –VM service –Performance issue in time and space.
Tolerating Memory Leaks Michael D. Bond Kathryn S. McKinley.
Flexible Reference-Counting-Based Hardware Acceleration for Garbage Collection José A. Joao * Onur Mutlu ‡ Yale N. Patt * * HPS Research Group University.
Taking Off The Gloves With Reference Counting Immix
380C Lecture 17 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Why you need to care about workloads.
An Adaptive, Region-based Allocator for Java Feng Qian, Laurie Hendren {fqian, Sable Research Group School of Computer Science McGill.
Ulterior Reference Counting: Fast Garbage Collection without a Long Wait Author: Stephen M Blackburn Kathryn S McKinley Presenter: Jun Tao.
Fast Conservative Garbage Collection Rifat Shahriyar Stephen M. Blackburn Australian National University Kathryn S. M cKinley Microsoft Research.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
CSC 213 – Large Scale Programming. Today’s Goals  Consider what new does & how Java works  What are traditional means of managing memory?  Why did.
Copyright (c) 2004 Borys Bradel Myths and Realities: The Performance Impact of Garbage Collection Paper: Stephen M. Blackburn, Perry Cheng, and Kathryn.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger,
Finding Your Cronies: Static Analysis for Dynamic Object Colocation Samuel Z. Guyer Kathryn S. McKinley T H E U N I V E R S I T Y O F T E X A S A T A U.
Computer Science Department Daniel Frampton, David F. Bacon, Perry Cheng, and David Grove Australian National University Canberra ACT, Australia
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
Investigating the Effects of Using Different Nursery Sizing Policies on Performance Tony Guan, Witty Srisa-an, and Neo Jia Department of Computer Science.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Hash-Based Indexes Chapter 11 Modified by Donghui Zhang Jan 30, 2006.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Yi Feng & Emery Berger University of Massachusetts Amherst A Locality-Improving.
380C lecture 19 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Opportunity to improve data locality.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
1 Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT) Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss (UMass),
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
2/4/20161 GC16/3011 Functional Programming Lecture 20 Garbage Collection Techniques.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
An Efficient, Incremental, Automatic Garbage Collector P. Deutsch and D. Bobrow Ivan JibajaCS 395T.
1 The Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT), Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Dynamic Compilation Vijay Janapa Reddi
Rifat Shahriyar Stephen M. Blackburn Australian National University
Ulterior Reference Counting Fast GC Without The Wait
David F. Bacon, Perry Cheng, and V.T. Rajan
Strategies for automatic memory management
Memory Management Kathryn McKinley.
Beltway: Getting Around Garbage Collection Gridlock
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Garbage Collection Advantage: Improving Program Locality
Program-level Adaptive Memory Management
Presentation transcript:

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University of Massachusetts Amherst

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Performance Garbage collection now performs reasonably well High throughput Low pause times Given large heap and sufficient memory But: what happens when there’s not enough RAM?

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging RAM Hard Disk Heap: most pages in RAM, one on disk GC begins

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging Collector touches an evicted page... RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging... bringing the page into memory... RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging RAM Hard Disk... but triggers another page eviction.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging RAM Hard Disk... but triggers another page eviction.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging Collector touches newly-evicted page... RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging RAM Hard Disk Collector touches newly-evicted page...

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging... leading to the eviction of yet another page… RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science GC Performance While Paging … which eventually triggers more paging. RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Program Throughput Paging causes a 40 to 62-fold increase in runtime

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Outline Motivation GC without paging Cooperative garbage collection Bookmarking Results

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science The problem Garbage collector: VM-oblivious Examines all reachable objects Lacks knowledge of page residency Treats evicted and resident pages identically Virtual memory: GC-oblivious GC & application have different access patterns Likely to evict pages needed by GC

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Cooperative Garbage Collection Bookmarking collector Extended virtual memory manager Select victim(s) Update residency page eviction notification victim page(s) Page replacement In response to notifications, BC: Adjusts heap size to fit in main memory Prevents eviction of important pages Avoids touching non-resident pages

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Avoiding Page Evictions When notified, avoid a pending eviction… 0000 RAM Hard Disk 0

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Avoiding Page Evictions …find a page BC knows to be empty… 0000 RAM Hard Disk 0

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Avoiding Page Evictions … and discard it… 0000 RAM Hard Disk 0

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Avoiding Page Evictions … eliminating the need to evict a page RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Limit of Heap Sizing Could collect, compact, compress, etc. Eventually: Will run out of pages to discard Going to have to evict non-empty pages Result: Paging Can we avoid this?

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Bookmarks We introduce bookmarks: Summaries of connectivity info on evicted pages References from objects on the page These summaries enable GC w/o paging

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0000 Bookmarking RAM Hard Disk Process page before eviction…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0000 Bookmarking B B... by following pointers & bookmark-ing targets... RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0000 Bookmarking B B... increment the referring page count... RAM Hard Disk 1

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 1000 Bookmarking BB BB B B B... conservatively bookmark objects on the page... RAM Hard Disk

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 000 Bookmarking... then tell extended VM to evict the page. RAM Hard Disk 0 BB BB B B B 1

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Bookmarking Details Cheap summary of connectivity One bit per object: free One word per page: referring page count Bookmarks cleared when count = zero Use bookmarks as secondary roots during garbage collection

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks Process objects as usual, but... B B roots

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks... ignore any references to evicted pages. B B roots

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks Use bookmarks to recreate evicted references... B B roots

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks... and continue collection. roots B B

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks B B roots Result: Garbage collection without paging!

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Collection with Bookmarks B B roots Note: can waste space on evicted pages.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Bookmarking Incompleteness Space waste not just on evicted pages Collection with bookmarks is necessarily incomplete Not guaranteed to reclaim all memory

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Bookmarking Incompleteness B B When a reference to an evicted object changes…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Bookmarking Incompleteness B B When a reference to an evicted object changes…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science RAM Hard Disk Bookmarking Incompleteness BB BB B B B …it can make evicted objects unreachable.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Bookmarking Incompleteness B B But bookmarks cannot be removed…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Bookmarking Incompleteness B B …retaining unreachable heap objects.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Bookmarking Completeness Worst-case: completeness requires duplicating evicted pages See paper for more info How can we preserve completeness?

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science 0 BB BB B 100 RAM Hard Disk Bookmarking Completeness B B If the heap becomes full…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science RAM Hard Disk Bookmarking Completeness …BC removes all bookmarks…

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science ??? Bookmarking Completeness …and performs a VM-oblivious collection...

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science ??? Bookmarking Completeness …reclaiming all unreachable objects.

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science ??? Bookmarking Completeness …reclaiming all unreachable objects. BC’s worst case is other collectors’ common case

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science BC Performance Optimizations Uses generational design similar to GenMS Yields good performance when not paging Compacts heap to reduce pressure Prevents single object from tying down a page

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Outline Motivation GC without paging Cooperative garbage collection Bookmarking Results

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Experimental Methodology Extended Linux kernel Eviction notification vm_relinquish() Added only 600 LOC Jikes RVM & MMTk Compare BC to MarkSweep, SemiSpace, CopyMS, GenCopy, GenMS

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Throughput w/o Memory Pressure BC runtime comparable to GenMS

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Throughput while Paging BC throughput closely follows ideal curve

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science BMU Curve w/ Memory Pressure Bookmarking crucial for good performance 0.0% 1566 ms 71.9% ms 0.0% ms 39.1% ms

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Summary of Results When not paging: BC as fast as GenMS When paging: vs. GenMS (fastest when not paging) 41x faster, avg pause up to 218x smaller vs. CopyMS (next fastest when paging) 5x faster, avg pause up to 45x smaller

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Conclusion Bookmarking collector available at:

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Thank you

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Other Pointer Summarizations Pointer Compression Save space by compressing pointers Tracing pointers becomes expensive Remembered Sets Add evicted pointers to buffers Requires space upon pages eviction Per Object Referring Page Counts Increases BC overheads

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Related Work VM-Sensitive Garbage Collection Linearizing LISP lists [Bobrow/Murphy] Does not know or use which heap pages are memory resident Independent heap regions [Bishop] Cannot avoid page faults when region contains evicted pages Ephemeral garbage collection [Moon] Must access evicted pages when they contain pointers into generations being collected

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Related Work VM-Cooperative Garbage Collection Discarding empty pages [Cooper, et al.] No mechanism for evicting non-empty pages Shrinking heap size [Alonso/Appel] Responds to memory pressure changes only after a collection Automatic heap sizing [Yang, et al.] Orthogonal approach that determines proper heap size

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Throughput w/ Memory Pressure  BC outperforms fixed nursery collectors

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Multiprogramming Performance  BC performs well in many environments

U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Experimental Methodology Benchmarks: SPECjvm98, ipsixql, jython, and pseudoJBB “Opt-and-reset” methodology First iteration optimizes all code Record results from second run