Correctness-Preserving Derivation of Concurrent Garbage Collection Algorithms Martin T. Vechev Eran Yahav David F. Bacon University of Cambridge IBM T.J.

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

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.
A Rely-Guarantee-Based Simulation for Verifying Concurrent Program Transformations Hongjin Liang, Xinyu Feng & Ming Fu Univ. of Science and Technology.
Paraglide Martin Vechev Eran Yahav Martin Vechev Eran Yahav.
Reducing Pause Time of Conservative Collectors Toshio Endo (National Institute of Informatics) Kenjiro Taura (Univ. of Tokyo)
Bounding Space Usage of Conservative Garbage Collectors Ohad Shacham December 2002 Based on work by Hans-J. Boehm.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
An On-the-Fly Mark and Sweep Garbage Collector Based on Sliding Views Hezi Azatchi - IBM Yossi Levanoni - Microsoft Harel Paz – Technion Erez Petrank –
On-the-Fly Garbage Collection: An Exercise in Cooperation Edsget W. Dijkstra, Leslie Lamport, A.J. Martin and E.F.M. Steffens Communications of the ACM,
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
Asynchronous Assertions Eddie Aftandilian and Sam Guyer Tufts University Martin Vechev ETH Zurich and IBM Research Eran Yahav Technion.
Efficient Concurrent Mark-Sweep Cycle Collection Daniel Frampton, Stephen Blackburn, Luke Quinane and John Zigman (Pending submission) Presented by Jose.
Mark DURING Sweep rather than Mark then Sweep Presented by Ram Mantsour Authors: Chrisitan Queinnec, Barbara Beaudoing, Jean-Pierre Queille.
CS 536 Spring Automatic Memory Management Lecture 24.
An Efficient Machine-Independent Procedure for Garbage Collection in Various List Structures, Schorr and Waite CACM August 1967, pp Curtis Dunham.
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.
Garbage Collection Mooly Sagiv html://
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.
0 Parallel and Concurrent Real-time Garbage Collection Part I: Overview and Memory Allocation Subsystem David F. Bacon T.J. Watson Research Center.
Connectivity-Based Garbage Collection Presenter Feng Xian Author Martin Hirzel, et.al Published in OOPSLA’2003.
Deriving Linearizable Fine-Grained Concurrent Objects Martin Vechev Eran Yahav IBM T. J. Watson Research Center Martin Vechev Eran Yahav IBM T. J. Watson.
Incremental Garbage Collection
Compilation 2007 Garbage Collection Michael I. Schwartzbach BRICS, University of Aarhus.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
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 Mooly Sagiv
Damien Doligez Georges Gonthier POPL 1994 Presented by Eran Yahav Portable, Unobtrusive Garbage Collection for Multiprocessor Systems.
Uniprocessor Garbage Collection Techniques Paul R. Wilson.
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.
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.
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center The Metronome: A Hard Real-time Garbage Collector.
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.
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.
Message Analysis-Guided Allocation and Low-Pause Incremental Garbage Collection in a Concurrent Language Konstantinos Sagonas Jesper Wilhelmsson Uppsala.
Chameleon Automatic Selection of Collections Ohad Shacham Martin VechevEran Yahav Tel Aviv University IBM T.J. Watson Research Center Presented by: Yingyi.
1 Real-Time Replication Garbage Collection Scott Nettles and James O’Toole PLDI 93 Presented by: Roi Amir.
CGCExplorer: A Semi-Automated Search Procedure for Provably Correct Concurrent Collectors Martin Vechev Eran Yahav David Bacon University of CambridgeIBM.
Incremental Garbage Collection Uwe Kern 23. Januar 2002
Compilation (Semester A, 2013/14) Lecture 13b: Memory Management Noam Rinetzky Slides credit: Eran Yahav 1.
Computer Science Department Daniel Frampton, David F. Bacon, Perry Cheng, and David Grove Australian National University Canberra ACT, Australia
List Processing in Real Time on a Serial Computer Henry G. Baker, Jr. CS395T: Hadi Esmaeilzadeh February 2009.
Fast Garbage Collection without a Long Wait Steve Blackburn – Kathryn McKinley Presented by: Na Meng Ulterior Reference Counting:
Concurrent Garbage Collection Presented by Roman Kecher GC Seminar, Tel-Aviv University 23-Dec-141.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
David F. Bacon Perry Cheng V.T. Rajan IBM T.J. Watson Research Center ControllingFragmentation and Space Consumption in the Metronome.
GARBAGE COLLECTION IN AN UNCOOPERATIVE ENVIRONMENT Hans-Juergen Boehm Computer Science Dept. Rice University, Houston Mark Wieser Xerox Corporation, Palo.
A REAL-TIME GARBAGE COLLECTOR WITH LOW OVERHEAD AND CONSISTENT UTILIZATION David F. Bacon, Perry Cheng, and V.T. Rajan IBM T.J. Watson Research Center.
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.
Real-time collection for multithreaded Java Microcontroller Garbage Collection. Garbage Collection. Application of Java in embedded real-time systems.
Concurrent Mark-Sweep Presented by Eyal Dushkin GC Seminar, Tel-Aviv University
® 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.
The Metronome Washington University in St. Louis Tobias Mann October 2003.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Seminar in automatic tools for analyzing programs with dynamic memory
Rifat Shahriyar Stephen M. Blackburn Australian National University
Concepts of programming languages
Cycle Tracing Chapter 4, pages , From: "Garbage Collection and the Case for High-level Low-level Programming," Daniel Frampton, Doctoral Dissertation,
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.
Reference Counting.
Mooly Sagiv html:// Garbage Collection Mooly Sagiv html://
Presentation transcript:

Correctness-Preserving Derivation of Concurrent Garbage Collection Algorithms Martin T. Vechev Eran Yahav David F. Bacon University of Cambridge IBM T.J. Watson Research Center PLDI – June 2006

Why Concurrent Garbage Collection ? Java and C#  Garbage-collected languages are prevalent Multicore  Concurrency is becoming prevalent Cheap RAM  Large heaps are becoming prevalent Real-Time Systems  More widely used

Memory Model Thread Model Concurrency Primitives CPU primitives Tracing/reference counting moving Allocate White / Black Dijkstra / Steele / Yuasa Barrier Atomic / Incremental Stack Snapshot Write Barrier Atomic / Non-atomic Color toggle, stacklets etc etc etc Implementation Existing Way to Create a Concurrent GC ENVIRONMENT REQUIREMENTS TECHNIQUES ?? Hard to verify/test Often buggy Did the monkey choose well?? Throughput Memory Consumption Pause Time

Ben-Ari Base ‘84 Dijkstra(C) ‘78 Doligez(C) ‘93 Azatchi ‘03 Domani ‘03 Yuasa ‘90 Pixley ‘88 Ben-Ari Base ‘84 Doligez ‘94 Ben-Ari Extended ‘84 Steele(C) ‘75 Boehm ‘91 Barabash ‘03 ‘03 ALGORITHMS PROOFS Concurrent GC algorithms and proofs are hard Incorrect Correct (C) Corrected FAMILY THEOREM PROVING

Optimal Correct Implementation Our Research Vision Memory Model Thread Model Concurrency Primitives CPU primitives ENVIRONMENT (Declarative Specification) Formally Defined Techniques Automated System Throughput Memory Consumption Pause Time REQUIREMENTS

In This Work Memory Model Thread Model Concurrency Primitives CPU primitives FIXED ENVIRONMENT Formally Defined Techniques for Tracing Non- Moving GC Automated System REQUIREMENTS Throughput Pause Time Memory Consumption Algorithm 1 Algorithm 2 Algorithm 3 Algorithm N <<< …

Problem : Interference A C B Traced Not Traced 1. GC traced B SYSTEM = MUTATOR || GC

Problem : Interference A C B A C B Traced Not Traced 1. GC traced B2. Mutator links C to B SYSTEM = MUTATOR || GC

Problem : Interference A C B A C B A C B X Traced Not Traced 1. GC traced B2. Mutator links C to B 3. Mutator unlinks C from A SYSTEM = MUTATOR || GC

Problem : Interference A C B A C B A C B A C B Traced Not Traced C LOST 1. GC traced B2. Mutator links C to B 3. Mutator unlinks C from A 4. GC traced A SYSTEM = MUTATOR || GC

The 3 Families of Concurrent GC Algorithms A C B 1. Marks C when C is linked to B (DIJKSTRA) A C B 2. Marks C when link to C is removed (YUASA) X A C B 3. Rescan B when C is linked to B (STEELE) Solutions are applied uniformly for all objects C C B

Contributions Systematic Exploration  A new parametric model of concurrent GC  Better understanding  New algorithms – potentially useful Formal Relationship between algorithms  Space - Relative precision between algorithms Sharing Proof Burden  Correctness-preserving “transformations”

A Parametric Concurrent GC Skeleton Intuition : Common out as much as possible Record interaction history between collector and mutator during tracing Collector exposes “hidden objects” based on entire interaction history

mark … reclaim Complete Garbage Collection Expose(L,D) Change Heap COLLECTOR MUTATOR markExpose(L,D) Change Heap A Parametric Concurrent GC Skeleton

Dimensions: an intuition The effect of each Mutator/GC action is controlled by a dimension Collector Scans PointerWavefront Granularity Mutator Allocates ObjectAllocation Color AB Mutator Creates Pointer Counting Mutator Overwrites Pointer Snapshot X C

Implementation Choice: Wavefront Per-Field Wavefront Exact information One bit per field More expensive More synchronization More garbage collected Per-Object Wavefront Approximate Information One bit per object Less expensive Less synchronization Less garbage collected

Choice: Record on Link or Unlink Record on Link More synchronization More garbage collected Record on Unlink Less synchronization Less garbage collected X

Combined Choices Record on LinkRecord on Unlink Per-Field WF Per-Object WF AB X X AB AB AB

Combined Choices Per Object Rec. Link A Rec. Link B Rec. Link A Unlink B Per-Field A Per-Field B Rec. Unlink A Rec. Link B Rec. Unlink A Rec. Unlink B Per-Field A Per-Obj B Per-Obj A Per-Field B Per-Obj A Per-Obj B X X X X X X X X A B

Correctness Transformations = Proof Steps APEX (U, U, U, U, {}) APEX (U, U, U, U, {}) STEELE DIJKSTRA (stacks,U,{},U,{}) STEELE-D STEELE-YC STEELE-D-YC DIJKSTRA-OLD DIJKSTRA-YC STEELE-BC HYBRID-YC (stacks,A,{},{},{}) HYBRID-YC (stacks,A,{},{},{}) STEELE-D-BC DIJKSTRA-BC YUASA (stacks, A, {}, {}, U) START WITH A CORRECT ALGORITHM RETAIN LESS GARBAGE RETAIN MORE GARBAGE

Intuition: an algorithm is more precise than another if it collects more garbage An algorithm that is less precise (more conservative) than a correct algorithm is guaranteed to be correct Should be a reference point for practical comparisons  no ad-hoc methods Hard to do manually: need a tool to provide insights  Finding the “right” definition was harder than proving safety, yet simpler than “relative concurrency” Relative Precision

Precision APEX (U, U, U, U, {}) APEX (U, U, U, U, {}) STEELE DIJKSTRA (stacks,U,{},U,{}) STEELE-D STEELE-YC STEELE-D-YC DIJKSTRA-OLD DIJKSTRA-YC STEELE-BC HYBRID-YC (stacks,A,{},{},{}) HYBRID-YC (stacks,A,{},{},{}) STEELE-D-BC DIJKSTRA-BC YUASA (stacks, A, {}, {}, U) MORE PRECISE LESS PRECISE

Conclusions Systematic exploration of an algorithm space  Useful new algorithms Formal definition of Relative precision between algorithms A first step towards automatic derivation of concurrent garbage collectors