Glacier: A Garbage Collection Simulation System

Similar documents
Garbage Collection. Steven R. Bagley

Garbage Collection. Hwansoo Han

Run-Time Environments/Garbage Collection

Lecture 15 Garbage Collection

Run-time Environments -Part 3

Garbage Collection Algorithms. Ganesh Bikshandi

Managed runtimes & garbage collection. CSE 6341 Some slides by Kathryn McKinley

CS 345. Garbage Collection. Vitaly Shmatikov. slide 1

Managed runtimes & garbage collection

Dynamic Data Structures. CSCI 112: Programming in C

Automatic Memory Management

One-Slide Summary. Lecture Outine. Automatic Memory Management #1. Why Automatic Memory Management? Garbage Collection.

Garbage Collection. Weiyuan Li

Heap storage. Dynamic allocation and stacks are generally incompatible.

Mozart System Limitations for Version (draft)

Exploiting the Behavior of Generational Garbage Collector

Compiler Construction

Hard Real-Time Garbage Collection in Java Virtual Machines

Runtime. The optimized program is ready to run What sorts of facilities are available at runtime

Run-time Environments - 3

CMSC 330: Organization of Programming Languages

ECE 2035 Programming HW/SW Systems Fall problems, 5 pages Exam Three 28 November 2012

Book keeping. Will post HW5 tonight. OK to work in pairs. Midterm review next Wednesday

Lecture Notes on Garbage Collection

Compiler Construction

CS61, Fall 2012 Section 2 Notes

ACM Trivia Bowl. Thursday April 3 rd (two days from now) 7pm OLS 001 Snacks and drinks provided All are welcome! I will be there.

Sustainable Memory Use Allocation & (Implicit) Deallocation (mostly in Java)

Acknowledgements These slides are based on Kathryn McKinley s slides on garbage collection as well as E Christopher Lewis s slides

MEMORY MANAGEMENT HEAP, STACK AND GARBAGE COLLECTION

Performance of Non-Moving Garbage Collectors. Hans-J. Boehm HP Labs

CMSC 330: Organization of Programming Languages

Lecture 13: Garbage Collection

ECE 2035 Programming HW/SW Systems Fall problems, 5 pages Exam Three 19 November 2014

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

PERFVIEW..NET runtime performance and ETW event analysis tool

Field Analysis. Last time Exploit encapsulation to improve memory system performance

Garbage Collection. Akim D le, Etienne Renault, Roland Levillain. May 15, CCMP2 Garbage Collection May 15, / 35

CMSC 330: Organization of Programming Languages. Memory Management and Garbage Collection

6.172 Performance Engineering of Software Systems Spring Lecture 9. P after. Figure 1: A diagram of the stack (Image by MIT OpenCourseWare.

CPSC 3740 Programming Languages University of Lethbridge. Data Types

Contents. 8-1 Copyright (c) N. Afshartous

Q1: /8 Q2: /30 Q3: /30 Q4: /32. Total: /100

DNWSH - Version: 2.3..NET Performance and Debugging Workshop

Memory Management. Memory Management... Memory Management... Interface to Dynamic allocation

Complex, concurrent software. Precision (no false positives) Find real bugs in real executions

Harmony GC Source Code

CSE P 501 Compilers. Memory Management and Garbage Collec<on Hal Perkins Winter UW CSE P 501 Winter 2016 W-1

Programming II (CS300)

Hierarchical Real-time Garbage Collection

Design Issues. Subroutines and Control Abstraction. Subroutines and Control Abstraction. CSC 4101: Programming Languages 1. Textbook, Chapter 8

Structure of Programming Languages Lecture 10

I J C S I E International Science Press

Lecture 13: Complex Types and Garbage Collection

Parallel GC. (Chapter 14) Eleanor Ainy December 16 th 2014

NOTE: Answer ANY FOUR of the following 6 sections:

SABLEJIT: A Retargetable Just-In-Time Compiler for a Portable Virtual Machine p. 1


Compilers. 8. Run-time Support. Laszlo Böszörmenyi Compilers Run-time - 1

Cycle Tracing. Presented by: Siddharth Tiwary

Precise Garbage Collection for C. Jon Rafkind * Adam Wick + John Regehr * Matthew Flatt *

What goes inside when you declare a variable?

Introduction To C#.NET

Compiler Construction D7011E

Principles of Programming Languages Topic: Scope and Memory Professor Louis Steinberg Fall 2004

G Programming Languages - Fall 2012

Opera&ng Systems CMPSCI 377 Garbage Collec&on. Emery Berger and Mark Corner University of Massachuse9s Amherst

C10: Garbage Collection and Constructors

Kakadu and Java. David Taubman, UNSW June 3, 2003

Motivation for Dynamic Memory. Dynamic Memory Allocation. Stack Organization. Stack Discussion. Questions answered in this lecture:

Processes. Johan Montelius KTH

Software Speculative Multithreading for Java

OS Main Goals. 10/24/2013 Operating Systems, Beykent University 1

Heap, Variables, References, and Garbage. CS152. Chris Pollett. Oct. 13, 2008.

High-Level Language VMs

A process. the stack

Myths and Realities: The Performance Impact of Garbage Collection

Programmer Directed GC for C++ Michael Spertus N2286= April 16, 2007

Vertical Profiling: Understanding the Behavior of Object-Oriented Applications

Dynamic Memory Allocation

Implementation Garbage Collection

Garbage-First Garbage Collection by David Detlefs, Christine Flood, Steve Heller & Tony Printezis. Presented by Edward Raff

Memory Management 3/29/14 21:38

CS Computer Systems. Lecture 8: Free Memory Management

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Memory management COSC346

Distributed Garbage Collection. Distributed Systems Santa Clara University

Robust Memory Management Schemes

Pointers II. Class 31

Garbage Collection Basics

Automatic Garbage Collection

JamaicaVM Java for Embedded Realtime Systems

Rob Legrand, and Ron K Cytron Washington University in St Louis 1 Brookings Dr Saint Louis, MO

Eventrons: A Safe Programming Construct for High-Frequency Hard Real-Time Applications

The Z Garbage Collector Scalable Low-Latency GC in JDK 11

Java Internals. Frank Yellin Tim Lindholm JavaSoft

A.Arpaci-Dusseau. Mapping from logical address space to physical address space. CS 537:Operating Systems lecture12.fm.2

Programming Languages

inside: THE MAGAZINE OF USENIX & SAGE August 2003 volume 28 number 4 PROGRAMMING McCluskey: Working with C# Classes

Shenandoah An ultra-low pause time Garbage Collector for OpenJDK. Christine H. Flood Roman Kennke

Transcription:

Glacier: A Garbage Collection Simulation System Bruno Dufour Sable Research Group McGill University Glacier: A Garbage Collection Simulation System p.1/19

Outline Introduction Objectives & motivation Requirements Design Testing Demo Related & future work Conclusions Glacier: A Garbage Collection Simulation System p.2/19

Introduction Garbage collection: memory management strategy which automatically reclaims heap-allocated memory Found in most modern languages: Java, Python,... Basic principle: unreachable objects are garbage Can be safely reclaimed Glacier: A Garbage Collection Simulation System p.3/19

Objectives & motivation Understanding how collectors work is hard Complex pointer manipulations Closely tied to architecture Goal: produce a simulator to allow modelling collectors Focus on use as a teaching tool Not necessarily suited to performance metrics Glacier: A Garbage Collection Simulation System p.4/19

Requirements Event-driven simulator Flexible event sources Ease of use model representation default trace format Flexibility ( what-if analyses) Event sources Models Monitoring tools Platform-independence Glacier: A Garbage Collection Simulation System p.5/19

Design Implemented as a set of Python modules 4 major components: Event source Model Simulation engine Simulation monitor Glacier: A Garbage Collection Simulation System p.6/19

Design Event source Event source sends execution events to simulator 6 required event classes are provided (can add more) Allocation Update Enter Exit GC Reset Glacier: A Garbage Collection Simulation System p.7/19

Design Event source Event source reads events from an execution trace Trace is text-based, for manual trace generation Trace contents: Options (header size, threads,... ) Entity definition (types, methods,... ) Events (allocation, update,... ) Glacier: A Garbage Collection Simulation System p.8/19

Design Sample trace # Options OPT HEADER_SIZE 32 # 4 byte headers OPT POINTER_SIZE 32 # 4 byte pointers OPT THREADS # Actions have associated threads # Entity definitions TYPEDEF PTR_PAIR 2 ref L car ref R cdr TYPEDEF INTEGER 1 atom V 16 0 value # 16-bit integer THREAD 0 MAIN GLOBAL ref R1 Root pointer to A # Instantiate objects ALLOC 0 A PTR_PAIR @R1 ALLOC 0 B INTEGER A.L ALLOC 0 C PTR_PAIR A.R ALLOC 0 D INTEGER C.L UPDATE 0 C.R A # Circular reference! UPDATE 0 @R1 NIL GC 0 Glacier: A Garbage Collection Simulation System p.9/19

Design Sample Trace R1 A B C D Glacier: A Garbage Collection Simulation System p.10/19

Design Models All models must extend GarbageCollector Models represent GC-managed heaps with 1 or more heap spaces Heap spaces are subdivisions of the heap Each heap space assumed to be contiguous in memory All heap objects must belong to exactly one heap space at any time Glacier provides a default free-list based heap space class Glacier: A Garbage Collection Simulation System p.11/19

Design Models Models are implemented by providing: getspaces() getextrafields() new(heapobject) delete(heapobject) write(reference, HeapObject) collect(roots) Glacier: A Garbage Collection Simulation System p.12/19

Design Simulation Engine Bridge between event source and model Manages execution stacks Controls GC model Keeps track of time in terms of amount of memory allocated Extensible by subclassing if new events are to be added Finding roots: Event source provides global references Simulation engine provides local references Glacier: A Garbage Collection Simulation System p.13/19

Design Monitors 2 possible types of monitors: Console-based GUI-based (visual) Based on Observer pattern 3 subject kinds Collector Simulation engine Execution stacks Necessary for complete system visualization Glacier: A Garbage Collection Simulation System p.14/19

Testing 2 significantly different collectors: Reference counting Stop & Copy (Semi-space collector) 2 monitors GC metrics (console) Heap watermark monitor (GUI) Traces Manually generated (small) Automatically generated from an expression tree evaluator (11K lines) Glacier: A Garbage Collection Simulation System p.15/19

Demo Glacier: A Garbage Collection Simulation System p.16/19

Related Work gcsim (U. Colorado) Designed to performance comparisons Implementation in Java Low-level details (memory blocks) Java-specific trace Glacier: A Garbage Collection Simulation System p.17/19

Conclusions Glacier... allows quick prototyping of garbage collector models is a flexible and versatile simulation framework is heavily customizable http://www.sable.mcgill.ca/ bdufou1/glacier/ Glacier: A Garbage Collection Simulation System p.18/19

Future Work Implement complete system visualization Add support for program location entities e.g. leak detection Implement support for arrays Support concurrent collectors Extend trace format Add more collector models Glacier: A Garbage Collection Simulation System p.19/19