Age-Based Garbage Collection

Slides:



Advertisements
Similar presentations
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Advertisements

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
Steve Blackburn Department of Computer Science Australian National University Perry Cheng TJ Watson Research Center IBM Research Kathryn McKinley Department.
Reconsidering Custom Memory Allocation Emery D. Berger Benjamin G. Zorn Kathryn S. McKinley November 2002 Proceedings of the Conference on Object-Oriented.
Lecture 21 Dynamic Memory Allocation:- *Allocation of objects in program ’ s heap _e.g. C ’ s malloc/free or Pascal ’ s new/dispose _e.g. C ’ s malloc/free.
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.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
Beltway: Getting Around Garbage Collection Gridlock Mrinal Deo CS395T Presentation March 2, Content borrowed from Jennifer Sartor & Kathryn McKinley.
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
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.
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
Connectivity-Based Garbage Collection Presenter Feng Xian Author Martin Hirzel, et.al Published in OOPSLA’2003.
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
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.
1 Presenter: Chien-Chih Chen Proceedings of the 2002 workshop on Memory system performance.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
A Parallel, Real-Time Garbage Collector Author: Perry Cheng, Guy E. Blelloch Presenter: Jun Tao.
SEG Advanced Software Design and Reengineering TOPIC L Garbage Collection Algorithms.
Exploiting Prolific Types for Memory Management and Optimizations By Yefim Shuf et al.
380C Lecture 17 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Why you need to care about workloads.
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
Ulterior Reference Counting: Fast Garbage Collection without a Long Wait Author: Stephen M Blackburn Kathryn S McKinley Presenter: Jun Tao.
A Real-Time Garbage Collector Based on the Lifetimes of Objects Henry Lieberman and Carl Hewitt (CACM, June 1983) Rudy Kaplan Depena CS395T: Memory Management.
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.
1 Tuning Garbage Collection in an Embedded Java Environment G. Chen, R. Shetty, M. Kandemir, N. Vijaykrishnan, M. J. Irwin Microsystems Design Lab The.
Copyright (c) 2004 Borys Bradel Myths and Realities: The Performance Impact of Garbage Collection Paper: Stephen M. Blackburn, Perry Cheng, and Kathryn.
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.
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
List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009.
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),
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center ControllingFragmentation and Space Consumption in the Metronome.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
® 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.
Simple Generational GC Andrew W. Appel (Practice and Experience, February 1989) Rudy Kaplan Depena CS 395T: Memory Management February 9, 2009.
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.
Memory Management What if pgm mem > main mem ?. Memory Management What if pgm mem > main mem ? Overlays – program controlled.
Topic: Java Garbage Collection
Dynamic Compilation Vijay Janapa Reddi
Interpreted languages Jakub Yaghob
Rifat Shahriyar Stephen M. Blackburn Australian National University
Automatic Memory Management/GC
Automatic Memory Management
Automatic Memory Management/GC
Ulterior Reference Counting Fast GC Without The Wait
Department of Computer Science University of California, Santa Barbara
David F. Bacon, Perry Cheng, and V.T. Rajan
Memory Management and Garbage Collection Hal Perkins Autumn 2011
Strategies for automatic memory management
Memory Management Kathryn McKinley.
Presentation: Cas Craven
Closure Representations in Higher-Order Programming Languages
Beltway: Getting Around Garbage Collection Gridlock
Chapter 12 Memory Management
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Garbage Collection Advantage: Improving Program Locality
Automating Memory Management
Pointer analysis John Rollinson & Kaiyuan Li
Reference Counting vs. Tracing
Presentation transcript:

Age-Based Garbage Collection Darko Stefanović, Kathryn McKinley, J. Eliot B. Moss OOPSLA ‘99 CS395T: Hadi Esmaeilzadeh February 2009

Outline Scavenging Generational Copying Collection (YO) Runtime Overheads Older-First (OF) Write Barrier and Heap Organization Contributions Statistics

Scavenging U={regions not collected}; assumed live C={regions collected} S={Survivors} G={Garbage}; copied/compacted Work proportional to |S| Copying Pointer-tracking What is the ideal case? What is the best heuristic? Non-generational: Degenerate case where U is empty Ideal case: we chose C such that S is empty Best heuristic: 1) Partitioning into C and U is trivial 2) S becomes small

Youngest-Only (YO) Intuition: Mortality rate is higher among young objects :((! Let C={Young objects} Objective: Minimize |S| Fewer survivors Copy less Track less

Runtime Overheads Copying the survivors Tracking the pointers crossing the boundaries In this case, only old-to-young pointers Write barrier (interleaving pointer-tracking with program execution) Cache: The place program and GC collide! Where is the trade-off? There is a trade-off between copying cost and pointer-tracking cost that can be exploited. Most pointer stores are among the young objects and by moving the collected region outside these youngest objects, GC (OF) must track more pointers However, OF lowers copying cost because it gives more time to die and does not collect the very youngest objects, which clearly have not had time to die.

Runtime Overheads: Early Tenuring (Promotion) Newly objects are promoted … What a shame! They die! Waste of time, space, … What else? Power!

Why Generational Collection Works Well Young objects die more quickly than old objects “generational hypothesis” [Unger’84,Hayes’91] Most pointers are from younger to older objects [Appel’89, Zorn’90] Do they apply to object oriented programs? Even though, the first statement is justified for functional programming languages, it is not generally true for OO programs Most stores are to objects that are very young, they install pointers to target that are also very young (whether relatively younger or older than the source) Kathryn’s

Older-First Garbage Collection Many objects die when they are middle age! Give the poor young objects a chance to live!

Older-First Garbage Collection Youngest Oldest Heap window Collection 1 survivors window Collection 2 survivors window Collection 3 survivors Kathryn’s

The Sweet Spot How do we allocate the new objects?

Design Decisions Sliding window determines C (Collection region) What is the design decision? What is the trade-off? Other alternatives? Window hits the allocation point Collect/compact objects Reset the window to the oldest objects Degree of freedom or added complexity? Who can help? Small window sizes are desirable because they contribute to keeping the pause time short, which is especially important in interactive programs. If window size is small, GC might fail because the long lived data spans more than the collection window? Window motion policy Easy to implement and fast. However, we might be able to go back to the sweet spot somehow! We start from the point where up-front know that |S| will be large. Let’s jump to the middle, where we had the sweet spot. In generational GC there is a tension between, the need to increase the size of the nursery so as to reduce such wasteful copying of young objects, and the need to increase the size of older generations so that they are not collected frequently. Compiler may be able to provide hints for the runtime system. History-based approaches might be helpful.

Write Barrier: Pointer Filtering for Older-First allocation oldest next collection youngest stored pointer, no store Runtime pointer direction filtering Do not record Pointers within the same block Pointers with source collected before target How can architecture help? Having an specific instruction for installing pointers. Kathryn’s

Trace Based Measurements Fully accurate traces All pointers between objects Precise object life times (collect after every allocation) Measured costs Copying Write barrier Remembered set processing Unmeasured effects Cache / locality interactions Startup What is the net speedup? Kathryn’s

Total Cost JavaBYTEmark Older-first is able to focus on an age range where wasteful copying is minimized, which result in good performance on those programs where such a range prominently exists. Kathryn’s

Total Cost Richards (Smalltalk)

Total Cost Bloat-Bloat Kathryn’s

Contributions More accurate explanations of generational collection (My favorite :))! Significant reduction in copying cost, by trading off pointer maintenance costs New write barrier mechanisms New promising algorithm Kathryn’s

Citation Statistics ACM portal: 28 Google scholar: 61 Narendran Sachindran , J. Eliot , B. Moss, Mark-copy: fast copying GC with less space overhead, ACM SIGPLAN Notices, v.38 n.11, November 2003 Feng Xian , Witawas Srisa-an , Hong Jiang, Allocation-phase aware thread scheduling policies to improve garbage collection performance, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, Canada Sebastien Marion , Richard Jones , Chris Ryder, Decrypting the Java gene pool, Proceedings of the 6th international symposium on Memory management, October 21-22, 2007, Montreal, Quebec, Canada William D. Clinger , Fabio V. Rojas, Linear combinations of radioactive decay models for generational garbage collection, Science of Computer Programming, v.62 n.2, p.184-203, 1 October 2006 Feng Xian , Witawas Srisa-an , Hong Jiang, Garbage collection: Java application servers' Achilles heel, Science of Computer Programming, v.70 n.2-3, p.89-110, February, 2008

Resources Ben Wiedermann’s presentation in 2003 class Improving Memory Performance for Java, Kathryn McKinley, CRA-W Distinguished Lecture, ECE CMU, 2000, http://amp.ece.cmu.edu/eceseminar/2000/Fall/Abstract/F00_McKinley.htm

Youngest Only GC Youngest Oldest Heap window uncollected Collection 1 survivors window uncollected Collection 2 survivors

Generational GC with 2 Generations nursery Youngest Oldest Heap window reserve uncollected Collection 1 from reserve survivors freed uncollected window reserve Collection 2 from reserve survivors freed window Collection 3 reserve