Fast Conservative Garbage Collection Rifat Shahriyar Stephen M. Blackburn Australian National University Kathryn S. M cKinley Microsoft Research.

Slides:



Advertisements
Similar presentations
An Implementation of Mostly- Copying GC on Ruby VM Tomoharu Ugawa The University of Electro-Communications, Japan.
Advertisements

Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
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.
Automatic Memory Management Noam Rinetzky Schreiber 123A /seminar/seminar1415a.html.
Compilation /15a Lecture 13 Compiling Object-Oriented Programs Noam Rinetzky 1.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
Garbage Collection  records not reachable  reclaim to allow reuse  performed by runtime system (support programs linked with the compiled code) (support.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
Efficient Concurrent Mark-Sweep Cycle Collection Daniel Frampton, Stephen Blackburn, Luke Quinane and John Zigman (Pending submission) Presented by Jose.
Rarely Copying Garbage Collection Yoshinori Kobayashi,Toshio Endo,Kenjiro Taura, Akinori Yonezawa University of Tokyo PLDI 2002 Student Research Forum.
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.
380C Where are we & where we are going – Managed languages Dynamic compilation Inlining Garbage collection What else can you do when you examine the heap.
CS 536 Spring Automatic Memory Management Lecture 24.
Using Prefetching to Improve Reference-Counting Garbage Collectors Harel Paz IBM Haifa Research Lab Erez Petrank Microsoft Research and Technion.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
Generational Stack Collection And Profile driven Pretenuring Perry Cheng Robert Harper Peter Lee Presented By Moti Alperovitch
File System Implementation CSCI 444/544 Operating Systems Fall 2008.
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
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 Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
Garbage Collection Memory Management Garbage Collection –Language requirement –VM service –Performance issue in time and space.
1 Overview Assignment 6: hints  Living with a garbage collector Assignment 5: solution  Garbage collection.
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.
Dynamic Memory Allocation Questions answered in this lecture: When is a stack appropriate? When is a heap? What are best-fit, first-fit, worst-fit, and.
Ulterior Reference Counting: Fast Garbage Collection without a Long Wait Author: Stephen M Blackburn Kathryn S McKinley Presenter: Jun Tao.
A Mostly Non-Copying Real-Time Collector with Low Overhead and Consistent Utilization David Bacon Perry Cheng (presenting) V.T. Rajan IBM T.J. Watson Research.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
Copyright (c) 2004 Borys Bradel Myths and Realities: The Performance Impact of Garbage Collection Paper: Stephen M. Blackburn, Perry Cheng, and Kathryn.
How’s the Parallel Computing Revolution Going? 1How’s the Parallel Revolution Going?McKinley Kathryn S. McKinley The University of Texas at Austin.
A Principled Approach to Nondeferred Reference-Counting Garbage Collection † Pramod G. Joisha HP Labs, Palo Alto † This work was done when the author was.
1 Lecture 22 Garbage Collection Mark and Sweep, Stop and Copy, Reference Counting Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction.
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
11/26/2015IT 3271 Memory Management (Ch 14) n Dynamic memory allocation Language systems provide an important hidden player: Runtime memory manager – Activation.
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.
Immix: A Mark-Region Garbage Collector Curtis Dunham CS 395T Presentation Feb 2, 2011 Thanks to Steve Blackburn and Jennifer Sartor for their 2008 and.
1 Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT) Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss (UMass),
Department of Computer Sciences Z-Rays: Divide Arrays and Conquer Speed and Flexibility Jennifer B. Sartor Stephen M. Blackburn,
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.
® July 21, 2004GC Summer School1 Cycles to Recycle: Copy GC Without Stopping the World The Sapphire Collector Richard L. Hudson J. Eliot B. Moss Originally.
CS412/413 Introduction to Compilers and Translators April 21, 1999 Lecture 30: Garbage collection.
.NET Memory Primer Martin Kulov. "Out of CPU, memory and disk, memory is typically the most important for overall system performance." Mark Russinovich.
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.
Introduction to Garbage Collection. GC Fundamentals Algorithmic Components AllocationReclamation 2 Identification Bump Allocation Free List ` Tracing.
Immix: A Mark-Region Garbage Collector Jennifer Sartor CS395T Presentation Mar 2, 2009 Thanks to Steve for his Immix presentation from
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
Jipeng Huang, Michael D. Bond Ohio State University
Memory Management and Garbage Collection Hal Perkins Autumn 2011
Strategies for automatic memory management
Memory Management Kathryn McKinley.
Chapter 12 Memory Management
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Garbage Collection Advantage: Improving Program Locality
Reference Counting.
Reference Counting vs. Tracing
Presentation transcript:

Fast Conservative Garbage Collection Rifat Shahriyar Stephen M. Blackburn Australian National University Kathryn S. M cKinley Microsoft Research

GC is Ubiquitous GC implementations Exact Conservative High performance systems use exact GC Conservative GC is popular 2 roots heap roots heap conservativeexact

Performance 3 16% slowdown a show-stopper in many situations

Root Conservative GC 4 roots heap int

Ambiguous References May be pointers – Retain referents, transitively – Excess retention May be values – Cannot change values – Pin referents May corrupt heap – Validate before updating per-object metadata 5

Why Conservative GC Advantages ✔ Disentangles GC from compiler ✔ Avoids challenging engineering of stack maps ✔ Enables more compiler optimizations Disadvantages ✘ Must handle ambiguous references ✘ Performance 6 Our goal is high performance conservative GC for managed languages

High Performance Exact Garbage Collectors 7

Immix [Blackburn & McKinley 2008] 0 0 Contiguous allocation into regions – 256B lines and 32KB blocks – Objects span lines but not blocks Simple mark phase – Mark objects and containing regions Free unmarked regions ✔ Recycled allocation and defragmentation 8 block line recyclable lines object markline mark line

RC Immix [Shahriyar et al. 2013] Combines RC and Immix ✔ Object local collection ✔ Great mutator locality Exploit Immix’s opportunistic copy – New objects can be copied by first GC – Old objects can be copied by backup GC ✔ Copying with RC to eliminate fragmentation

Conservative Garbage Collectors 10

Non-Moving Free list Designed for fully conservative settings Problems ✘ Poor performance ✘ Overly conservative design for many settings 11 roots heap

Mostly-Copying Semi Space a.k.a. Bartlett-style, with many variants Problems ✘ Semi-space suffers from huge collection cost ✘ Poor performance 12 roots heap

All exact217 Unique exact980.45x All cons x Unique cons x KB0.02% Actual pinned14 KB0.05% MCC pinned462 KB2.1% MCC false pinned282 KB Immix pinned36 KB0.2% Excess retention Pinning Roots Cost of Conservatism averaged over 20 Java benchmarks The direct cost of conservatism is very low

Heap Organization is Key 14

Outline ✔ Real source of performance overhead is not conservatism but heap organization Design and implementation of – Conservative Immix collectors – Conservative reference counting Evaluation 15

Design 16

Filtering Object map filters ambiguous references – Bitmap records locations of all live objects – Allocator sets bit encoding object start address – Collector clears bit for dead objects 17 roots heap

Cost of Filtering 18 Heap organization trumps object map overhead (2.7%)

Pinning Immix line pinning, opportunistic copying – Pin referents of ambiguous references – Logically pinned lines cannot be reused – Move other objects as space permits 19 roots heap

Results 20

Methodology 20 benchmarks – DaCapo, SPECjvm98 and pjbb invocations for each benchmark Jikes RVM and MMTk – All garbage collectors are parallel Intel Core i7 4770, 8GB Ubuntu LTS 21

Cost of Conservatism normalized to exact 22 Low performance penalty for conservative collectors cons

Total Time 23 RC Immix cons matches Gen Immix and RC Immix

Total Time v Heap Size 24 RC Immix cons matches Gen Immix and RC Immix cons

Wider Applicability 25

Conservatism and Pinning Amenability of existing systems to conservative RC Immix Quantify ambiguous references in target applications – Conservative RC Immix tolerates 8x pinning increase with only 3.4% overhead Modify heap organization to use lines and blocks Implement full-heap tracing Immix collector (5% improvement) – Depends on code quality 26

Summary Conservative GC – Dominated by BDW and MCC – Significant overheads – Heap org. key to performance New designs – Low overhead object map – Immix line based pinning Conservative RC Immix – Matches fastest production 27 Questions? Available at: