An Efficient Machine-Independent Procedure for Garbage Collection in Various List Structures, Schorr and Waite CACM August 1967, pp 501-506 Curtis Dunham.

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

PZ10B Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ10B - Garbage collection Programming Language Design.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Garbage Collection What is garbage and how can we deal with it?
Garbage Collection Introduction and Overview Christian Schulte Excerpted from presentation by Christian Schulte Programming Systems Lab Universität des.
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.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
Tail Recursion. Problems with Recursion Recursion is generally favored over iteration in Scheme and many other languages It’s elegant, minimal, can be.
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
Efficient Concurrent Mark-Sweep Cycle Collection Daniel Frampton, Stephen Blackburn, Luke Quinane and John Zigman (Pending submission) Presented by Jose.
Copyright, 1996 © Dale Carnegie & Associates, Inc. Mark-Sweep A tracing garbage collection technique Hagen Böhm November 21st, 2001
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
CS 536 Spring Automatic Memory Management Lecture 24.
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
Memory Management. History Run-time management of dynamic memory is a necessary activity for modern programming languages Lisp of the 1960’s was one of.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
CS 1114: Data Structures – memory allocation Prof. Graeme Bailey (notes modified from Noah Snavely, Spring 2009)
PZ10CX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ10CX - LISP Programming Language Design and Implementation.
MOSTLY PARALLEL GARBAGE COLLECTION Authors : Hans J. Boehm Alan J. Demers Scott Shenker XEROX PARC Presented by:REVITAL SHABTAI.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Memory Allocation and Garbage Collection. Why Dynamic Memory? We cannot know memory requirements in advance when the program is written. We cannot know.
The environment of the computation Declarations introduce names that denote entities. At execution-time, entities are bound to values or to locations:
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.
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.
Storage Management Lecture 12: Dolores Zage.
Fast, Effective Code Generation in a Just-In-Time Java Compiler Rejin P. James & Roshan C. Subudhi CSE Department USC, Columbia.
 Sowmiya Chocka Narayanan.  Problem Statement  Free listed exhausted!!! Mission Reclamation  Solution proposed  Newell, Simon and Shaw placed the.
Incremental Garbage Collection Uwe Kern 23. Januar 2002
Runtime Environments. Support of Execution  Activation Tree  Control Stack  Scope  Binding of Names –Data object (values in storage) –Environment.
Comparison of Compacting Algorithms for Garbage Collection Mrinal Deo CS395T – Spring
1 Lecture 22 Garbage Collection Mark and Sweep, Stop and Copy, Reference Counting Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction.
CS535 Programming Languages Chapter - 10 Functional Programming With Lists.
Heap storage & Garbage collection Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001.
Runtime System CS 153: Compilers. Runtime System Runtime system: all the stuff that the language implicitly assumes and that is not described in the program.
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.
University of Washington Wouldn’t it be nice… If we never had to free memory? Do you free objects in Java? 1.
GARBAGE COLLECTION IN AN UNCOOPERATIVE ENVIRONMENT Hans-Juergen Boehm Computer Science Dept. Rice University, Houston Mark Wieser Xerox Corporation, Palo.
Memory Management -Memory allocation -Garbage collection.
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.
2/4/20161 GC16/3011 Functional Programming Lecture 20 Garbage Collection Techniques.
The Metronome Washington University in St. Louis Tobias Mann October 2003.
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.
Simple Generational GC Andrew W. Appel (Practice and Experience, February 1989) Rudy Kaplan Depena CS 395T: Memory Management February 9, 2009.
An Efficient, Incremental, Automatic Garbage Collector P. Deutsch and D. Bobrow Ivan JibajaCS 395T.
Runtime Environments Chapter 7. Support of Execution  Activation Tree  Control Stack  Scope  Binding of Names –Data object (values in storage) –Environment.
Garbage Collecting the World Presentation: Mark Mastroieni Authors: Bernard Lang, Christian Queinne, Jose Piquer.
Garbage Collection What is garbage and how can we deal with it?
Tail Recursion.
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 7 – More Memory Management Lecturer PSOE Dan Garcia
Concepts of programming languages
Automatic Memory Management
Strategies for automatic memory management
Memory Management Kathryn McKinley.
List Processing in Real Time on a Serial Computer
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Heap storage & Garbage collection
List Allocation and Garbage Collection
Heap storage & Garbage collection
Garbage collection Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 7 – More Memory Management Lecturer PSOE Dan Garcia
Reference Counting.
Garbage Collection What is garbage and how can we deal with it?
Mooly Sagiv html:// Garbage Collection Mooly Sagiv html://
Presentation transcript:

An Efficient Machine-Independent Procedure for Garbage Collection in Various List Structures, Schorr and Waite CACM August 1967, pp Curtis Dunham CS 395T Memory Management, Spring 2011

 Technique not called “Mark-Sweep” in this work  SCHEME-79 paper (Holloway, Steele, Sussman, and Bell) the first to use this label  The verbs “trace” and “mark” are used however

 Credit for the idea given to John McCarthy (Lisp, 1960)  Section 4c of his Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I describes the same process of using the sign bit to mark memory cells, then scanning the heap

 Algorithm independently discovered by L Peter Deutsch

 Words in memory called “registers”  IBM 7094  bit words; 144 KB  0.5 MHz, or more charitably, 500 KHz

Three options for reclaiming memory: 1. Programmer does it manually 2. Reference Counting 3. “Garbage collection”, like McCarthy suggested

 McCarthy pretty much solved this, right?  Three problems, our authors claim: 1. Algorithms for “tracing the lists” (today, traversing the directed graph) at that time were expensive in either time or space 2. Signed numbers, or, Hey, I was using that sign bit 3. Heap objects occupying multiple words

 3 bits of the 36-bit words in a 7094 are for a prefix field  Use one of those bits to indicate what is actually stored in that word 1. the number of words that make up the heap object, or 2. the heap object itself data Another word 3 A word

 Use a large heap object, then the “interior” words have usable sign bits

 Must run in fixed space  No queue for breadth-first  No stack growth for recursive techniques, e.g. depth-first  Must trace efficiently  Bounded visits per object  Must handle circular lists 3 words 2 visits That, too.

 Mutator and collector do not run concurrently  Heap can be arbitrarily modified, so long as it is correct when the mutator resumes  In a depth-first recursive scheme, the stack provides “breadcrumbs” that allow us to find our way back  Reverse pointers as they are traversed  Easy to do, easy to undo, provides “breadcrumbs” for free (in terms of space)

Mark (sign bit) Depth (prefix bit) Head (car) Tail (cdr) Trace through (follow) Tail elements: 1.Reverse Pointers 2.Set Mark Bits Trace through (follow) Tail elements (again), Only this time, traversal is reversed. 1.Reverse Pointers (again) 2.Check Head fields for pointers. If any are found, recursively apply this procedure.

 This technique will mark everything on the heap that is reachable.  A sweep of the entire heap is necessary to find all the unmarked words, which are returned to the free list.  This algorithm solves “one-way list” tracing. With modification, it can trace others (see section 7 of paper)

 Testbed: pathological 5-list, 20K-element depth-12 “mess”  1.85s for this work  2.75s for Wilkes  0.448s for breadth-first with 48 element queue  Authors’ opinion  Space is available: use the breadth-first approach  Otherwise: this approach takes essentially no space; use it instead Cannot handle circular lists

 The authors mention a concern for portability  The final sweep through the heap is machine- dependent, but with just 6 special functions, the tracer/marking algorithm can be written in the higher level language (Wisp)  Analogous to MMTk’s Java GC in Java

(other than this paper, cited on title slide)    Gries, David. The Schorr-Waite graph marking algorithm  McCarthy, John. Recursive functions of symbolic expressions and their computation by machine, Part I. CACM April  Holloway, Jack; Steel, Guy Lewis, Jr.; Sussman, Gerald Jay; Bell, Alan. The SCHEME-79 Chip  Previous slides by Sowmiya Chocka Narayanan

 Experimental methodology  Performance of pointer reversals  Performance  Human-noticable delay in stop-the-world design  Motivation for incrementality, not waiting for heap to fill up, etc.?  Significance of “no-space” design today