Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.

Slides:



Advertisements
Similar presentations
1 Write Barrier Elision for Concurrent Garbage Collectors Martin T. Vechev Cambridge University David F. Bacon IBM T.J.Watson Research Center.
Advertisements

On-the-Fly Garbage Collection Using Sliding Views Erez Petrank Technion – Israel Institute of Technology Joint work with Yossi Levanoni, Hezi Azatchi,
Incorporating Generations into a Modern Reference Counting Garbage Collector Hezi Azatchi Advisor: Erez Petrank.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Garbage Collection What is garbage and how can we deal with it?
CSC 213 – Large Scale Programming. Today’s Goals  Consider what new does & how Java works  What are traditional means of managing memory?  Why did.
Memory Management Tom Roeder CS fa. Motivation Recall unmanaged code eg C: { double* A = malloc(sizeof(double)*M*N); for(int i = 0; i < M*N; i++)
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
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.
Heap Shape Scalability Scalable Garbage Collection on Highly Parallel Platforms Kathy Barabash, Erez Petrank Computer Science Department Technion, Israel.
NUMA Tuning for Java Server Applications Mustafa M. Tikir.
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 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
CS 536 Spring Automatic Memory Management Lecture 24.
ParMarkSplit: A Parallel Mark- Split Garbage Collector Based on a Lock-Free Skip-List Nhan Nguyen Philippas Tsigas Håkan Sundell Distributed Computing.
Using Prefetching to Improve Reference-Counting Garbage Collectors Harel Paz IBM Haifa Research Lab Erez Petrank Microsoft Research and Technion.
OOPSLA 2003 Mostly Concurrent Garbage Collection Revisited Katherine Barabash - IBM Haifa Research Lab. Israel Yoav Ossia - IBM Haifa Research Lab. Israel.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
An On-the-Fly Reference Counting Garbage Collector for Java Erez Petrank Technion – Israel Institute of Technology Joint work with Yossi Levanoni – Microsoft.
MOSTLY PARALLEL GARBAGE COLLECTION Authors : Hans J. Boehm Alan J. Demers Scott Shenker XEROX PARC Presented by:REVITAL SHABTAI.
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.
Memory Allocation and Garbage Collection. Why Dynamic Memory? We cannot know memory requirements in advance when the program is written. We cannot know.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
1 An Efficient On-the-Fly Cycle Collection Harel Paz, Erez Petrank - Technion, Israel David F. Bacon, V. T. Rajan - IBM T.J. Watson Research Center Elliot.
Garbage collection (& Midterm Topics) David Walker COS 320.
1 Reducing Generational Copy Reserve Overhead with Fallback Compaction Phil McGachey and Antony L. Hosking June 2006.
Reference Counters Associate a counter with each heap item Whenever a heap item is created, such as by a new or malloc instruction, initialize the counter.
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.
SEG Advanced Software Design and Reengineering TOPIC L Garbage Collection Algorithms.
Exploiting Prolific Types for Memory Management and Optimizations By Yefim Shuf et al.
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.
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.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Memory management (CTM 2.5) Carlos Varela RPI April 6, 2015.
Storage Management. The stack and the heap Dynamic storage allocation refers to allocating space for variables at run time Most modern languages support.
Copyright (c) 2004 Borys Bradel Myths and Realities: The Performance Impact of Garbage Collection Paper: Stephen M. Blackburn, Perry Cheng, and Kathryn.
Message Analysis-Guided Allocation and Low-Pause Incremental Garbage Collection in a Concurrent Language Konstantinos Sagonas Jesper Wilhelmsson Uppsala.
OOPLs /FEN March 2004 Object-Oriented Languages1 Object-Oriented Languages - Design and Implementation Java: Behind the Scenes Finn E. Nordbjerg,
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
Garbage Collection and Memory Management CS 480/680 – Comparative Languages.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
G ARBAGE C OLLECTION CSCE-531 Ankur Jain Neeraj Agrawal 1.
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
Introduction to Garbage Collection. Garbage Collection It automatically reclaims memory occupied by objects that are no longer in use It frees the programmer.
® 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.
Reference Counting. Reference Counting vs. Tracing Advantages ✔ Immediate ✔ Object-local ✔ Overhead distributed ✔ Very simple Trivial implementation for.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
GARBAGE COLLECTION Student: Jack Chang. Introduction Manual memory management Memory bugs Automatic memory management We know... A program can only use.
Garbage Collection What is garbage and how can we deal with it?
Rifat Shahriyar Stephen M. Blackburn Australian National University
Concepts of programming languages
Automatic Memory Management
Cycle Tracing Chapter 4, pages , From: "Garbage Collection and the Case for High-level Low-level Programming," Daniel Frampton, Doctoral Dissertation,
Smart Pointers.
Memory Management and Garbage Collection Hal Perkins Autumn 2011
Strategies for automatic memory management
Memory Management Kathryn McKinley.
Beltway: Getting Around Garbage Collection Gridlock
Automating Memory Management
Reference Counting.
Garbage Collection What is garbage and how can we deal with it?
Reference Counting vs. Tracing
Presentation transcript:

Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland

2Compiler Construction, April 2005Age-Oriented GC Garbage Collection User allocates space dynamically, the garbage collector automatically frees the space when it no longer reachable by a path of pointers from program local references (roots). Programmer does not have to decide when to free an object. (Memory leaks, dangling pointers.) Built into Java, C#.

3Compiler Construction, April 2005Age-Oriented GC Garbage Collection Today Today’s advanced environments: –multiprocessors + large memories Dealing with multiprocessors Single-threaded stop the world

4Compiler Construction, April 2005Age-Oriented GC Garbage Collection Today Today’s advanced environments: –multiprocessors + large memories Dealing with multiprocessors Concurrent collectionParallel collection High throughputShort pauses

5Compiler Construction, April 2005Age-Oriented GC Outline Garbage collection and modern platforms  Properties of classical algorithms Generational garbage collection Age-oriented collection Implementation, measurements Conclusion

6Compiler Construction, April 2005Age-Oriented GC Garbage Collection Two Classical Approaches Reference counting [Collins 1960]: keep a reference count for each object, reclaim objects with count 0. Tracing [McCarthy 1960]: trace reachable objects, reclaim objects not traced. Complexity: - traversal of live objects - (sweep is typically fast) Complexity: - tracking pointer modific’s - traversal of dead objects

7Compiler Construction, April 2005Age-Oriented GC Choosing a Collector Reference counting Best when most objects alive, and low “activity”. Tracing: Best when most objects dead. When are objects typically dead? The generational hypothesis: most objects die young.

8Compiler Construction, April 2005Age-Oriented GC Generational Garbage Collection [Lieberman-Hewitt 83, Ungar 84]: Segregate objects by age into generations. Objects allocated in the young generation, promoted into the old generation if they survive long enough. Frequently collect the young generation Collect full heap when needed. Most pauses are short (for young generation GC). Collection effort concentrated where garbage is. Old Young

9Compiler Construction, April 2005Age-Oriented GC Note Interesting Characteristics Young generation: most objects die & high activity. Tracing is best when most objects die. Old generation: most objects alive and slow activity. Reference counting is best. Conclusion: use RC for old & tracing for young. Already done by [Azatchi-Petrank CC’03] [Blackburn-Mckinley OOPSLA’03]

10Compiler Construction, April 2005Age-Oriented GC Size of Young Generation small young generation  (mostly) short pauses large young generation  high efficiency Appel’s collector uses a large young generation and obtains highest efficiency.

11Compiler Construction, April 2005Age-Oriented GC Observation 1 large young generation  high efficiency but long pauses concurrent collector  short pauses Observation 1: we want the largest possible young generation.

12Compiler Construction, April 2005Age-Oriented GC Observation 2 Delaying collection of the old generation is fundamentally tracing- oriented. Complexity of tracing is fixed: delay it. Complexity of RC accumulates (update counters, traverse the unreachable) no use in delaying it.

13Compiler Construction, April 2005Age-Oriented GC Observation 2 Delaying collection of the old generation is fundamentally tracing- oriented. We use RC for old generation Observation 2: No use in delaying collection of old objects.

14Compiler Construction, April 2005Age-Oriented GC Conclusion Observation 1: we want the largest possible young generation. Observation 2: no use in delaying collection of old objects. Conclusion (age-oriented collection): collect entire heap with each collection

15Compiler Construction, April 2005Age-Oriented GC Age-Oriented vs. Generational Age-Oriented Always collect entire heap Collect each generation differently Generational Frequently collect young generation Collect young generation and full heap differently

16Compiler Construction, April 2005Age-Oriented GC Generational vs. Age-Oriented Old Young Old Young Old Young Age- Oriented: Old Young Old Young Old Young Old Young Old Young Old Young Old Young Standard: time

17Compiler Construction, April 2005Age-Oriented GC Age-Oriented Properties Advantages: Largest possible young generation. No frequent young collections. Each generation is treated according to its characteristics (like generational collectors). Potentially easier to obtain inter-generat’l ptr’s. Young Generation Old Generation A B

18Compiler Construction, April 2005Age-Oriented GC Age-Oriented Properties Advantages: Largest possible young generation. No frequent young collections. Each generation is treated according to its characteristics (like generational collectors). Potentially easier to obtain inter-generat’l ptr’s. Disadvantages: Longer pauses (if we don’t use concurrent GC.) May have a throughput penalty if tracing the old generation (not an issue for RC).

19Compiler Construction, April 2005Age-Oriented GC Age-Oriented Collection Age-Oriented Always collect entire heap Collect each generation differently A general framework: instantiated by picking collectors for the old and young generations and combining them.

20Compiler Construction, April 2005Age-Oriented GC Our Instantiation Building blocks: the sliding views collectors [Levanoni-Petrank 01, Azatchi et al. 03] –Old generation: concurrent RC. –Young generation: concurrent tracing. Technicalities: –Joining the two collectors –Inter-generational pointers

21Compiler Construction, April 2005Age-Oriented GC Implementation Implementation for Java on the Jikes Research JVM Compared collectors: –RC with no generation. –Generational: tracing for young & RC for full. Benchmarks: –SPECjbb2000: simulates business-like trans’s. –SPECjvm98: client benchmarks suite. Platform: a 4-Way Netfinity.

22Compiler Construction, April 2005Age-Oriented GC Pause Times vs. STW

23Compiler Construction, April 2005Age-Oriented GC SPECjbb Throughput (Age-Oriented vs. RC)

24Compiler Construction, April 2005Age-Oriented GC SPECjbb Throughput (Generational vs. RC)

25Compiler Construction, April 2005Age-Oriented GC SPECjvm98 Throughput (Age-Oriented vs. RC)

26Compiler Construction, April 2005Age-Oriented GC Throughput versus Parallel Tracing

27Compiler Construction, April 2005Age-Oriented GC Related Work [Azatzhi-Petrank CC’03] Concurrent generations with RC for full and tracing for young. (Very short pauses.) [Blackburn-Mckinley OOPSLA’03] Generations with RC for old and tracing for young. Non concurrent but controlled pauses. [Paz et al. CC’05] (coming soon…) Cycle Collection --- better do it only for old objects, via age-oriented collection. RC: some recent breakthrough, still work needed to get RC “right” for modern platforms.

28Compiler Construction, April 2005Age-Oriented GC Concurrent & Generational GC A general question for concurrent collectors: –Concurrent collectors already have short pauses, should we also use generations ? First experiment [Domani et al. PLDI’00]: –Beneficial, but unsteady improvements (-8% -- 25%). –Base was production JVM with mark & sweep. Second experiment: [Azatchi-Petrank, CC’03]: –Beneficial, 10-20% improvement. –Base was Jikes RVM with RC. Third try: Mostly Concurrent [ISMM’00, PLDI’02, OOPSLA’03]: –SUN: yes, no measurements. –IBM: no, (and no measurements). Fourth experiment: this work…

29Compiler Construction, April 2005Age-Oriented GC Conclusion The Age-Oriented collector improves efficiency of generational collectors –Especially with RC on old. –Especially with concurrent collectors. It is a framework, we tried an instantiation with: –Concurrent RC for old, concurrent tracing for young. The age-oriented collector was non-obtrusive (due to concurrency) and efficient (due to age- oriented) collector. An excellent way to employ RC.