Increasing Memory Usage in Real-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet

Slides:



Advertisements
Similar presentations
An Implementation of Mostly- Copying GC on Ruby VM Tomoharu Ugawa The University of Electro-Communications, Japan.
Advertisements

Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Dynamic Memory Management
CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
Garbage Collection What is garbage and how can we deal with it?
CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
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.
Hastings Purify: Fast Detection of Memory Leaks and Access Errors.
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
CPSC 388 – Compiler Design and Construction
Chapter 8 Runtime Support. How program structures are implemented in a computer memory? The evolution of programming language design has led to the creation.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
On the limits of partial compaction Anna Bendersky & Erez Petrank Technion.
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.
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.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
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.
Flexible Reference-Counting-Based Hardware Acceleration for Garbage Collection José A. Joao * Onur Mutlu ‡ Yale N. Patt * * HPS Research Group University.
COP4020 Programming Languages
Dynamic Memory Allocation Questions answered in this lecture: When is a stack appropriate? When is a heap? What are best-fit, first-fit, worst-fit, and.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
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.
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.
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.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Compilation (Semester A, 2013/14) Lecture 13b: Memory Management Noam Rinetzky Slides credit: Eran Yahav 1.
11/26/2015IT 3271 Memory Management (Ch 14) n Dynamic memory allocation Language systems provide an important hidden player: Runtime memory manager – Activation.
CSE 425: Control Abstraction I Functions vs. Procedures It is useful to differentiate functions vs. procedures –Procedures have side effects but usually.
Garbage Collection and Classloading Java Garbage Collectors  Eden Space  Surviver Space  Tenured Gen  Perm Gen  Garbage Collection Notes Classloading.
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.
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.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
® 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.
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.
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.
Garbage Collection What is garbage and how can we deal with it?
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 7 – More Memory Management Lecturer PSOE Dan Garcia
Java 9: The Quest for Very Large Heaps
Chapter 9 – Real Memory Organization and Management
CS 153: Concepts of Compiler Design November 28 Class Meeting
Distributed Garbage Collection
David F. Bacon, Perry Cheng, and V.T. Rajan
Closure Representations in Higher-Order Programming Languages
Binding Times Binding is an association between two things Examples:
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Lecturer PSOE Dan Garcia
Inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture 7 – More Memory Management Lecturer PSOE Dan Garcia
Program-level Adaptive Memory Management
Reference Counting.
CMPE 152: Compiler Design May 2 Class Meeting
Garbage Collection What is garbage and how can we deal with it?
Presentation transcript:

Increasing Memory Usage in Real-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet

27-9 October, 2002Increasing Memory Usage in Real-Time GC The Problem Published “real” real-time garbage collectors consume too much memory A large portion of the overhead is caused by type information, internal fragmentation, and GC house keeping However, most GC techniques also require a buffer to hold dead objects

37-9 October, 2002Increasing Memory Usage in Real-Time GC Mark-Sweep Root

47-9 October, 2002Increasing Memory Usage in Real-Time GC Buffer for Dead Objects

57-9 October, 2002Increasing Memory Usage in Real-Time GC Buffer for Dead Objects

67-9 October, 2002Increasing Memory Usage in Real-Time GC RT-Copying

77-9 October, 2002Increasing Memory Usage in Real-Time GC RT-Mark-Sweep (JamaicaVM)

87-9 October, 2002Increasing Memory Usage in Real-Time GC Available Memory The amount of available memory using real-time garbage collection and a heap of 12 – 36 byte objects (equally distributed) is Copying GC: 25% Copying GC: 25% Mark-Sweep (JamaicaVM):31% Mark-Sweep (JamaicaVM):31% Reference Counting:47% Reference Counting:47%

97-9 October, 2002Increasing Memory Usage in Real-Time GC Reference Counting Root

107-9 October, 2002Increasing Memory Usage in Real-Time GC Reference Counting Disadvantages to overcome Recursive freeing Recursive freeing External fragmentation External fragmentation Reclaiming dead cyclic data structures Reclaiming dead cyclic data structures Execution speed Execution speed

117-9 October, 2002Increasing Memory Usage in Real-Time GC Recursive Freeing The problem was solved for equally sized objects by Weizenbaum (1963) Decrementing child references is postponed until the memory is reused Still, all memory is available when it becomes unreachable However, objects are not always of the same size…

127-9 October, 2002Increasing Memory Usage in Real-Time GC External Fragmentation As in most file systems, the heap can be divided into equally sized blocks Small objects are linked using a list, while larger objects use a tree structure Minor performance penalty for small objects Weizenbaum’s technique to eliminate recursive freeing can be used on the blocks

137-9 October, 2002Increasing Memory Usage in Real-Time GC Dead Cyclic Data Structures Manual techniques cover most cases Breaking cycles Breaking cycles Weak references Weak references Balloon types Balloon types Automatic techniques are not real-time A backup real-time mark-sweep GC can be used but that increases memory overhead

147-9 October, 2002Increasing Memory Usage in Real-Time GC Execution Time Peep hole optimization Stack allocation Object owning (Data flow analysis)

157-9 October, 2002Increasing Memory Usage in Real-Time GC RT-Reference Counting All operations are predictable in memory usage and execution time Memory usage is increased by more than 50% for objects larger than 17 bytes Dead cyclic data structures can be reclaimed (to the cost of memory overhead)

167-9 October, 2002Increasing Memory Usage in Real-Time GC Impact of Block Size

177-9 October, 2002Increasing Memory Usage in Real-Time GC Impact of Block Size The diagrams show the overhead of the block header, the object header, and the internal fragmentation of a real-time reference counter using 16, 32, and 64 byte blocks Block Object Fragmentation

187-9 October, 2002Increasing Memory Usage in Real-Time GC Execution Time Comparison RT Copying RT Mark-Sweep RTRC AllocationO(s+1/o)O(s+1/o)O(s) AccessO(1)O(s)O(s) S = object size O = memory overhead for dead objects

197-9 October, 2002Increasing Memory Usage in Real-Time GC Implementations Real-Time Reference Counting has been implemented: As CPP macros As CPP macros In the JOSES Java compiler In the JOSES Java compiler In the Jamaica VM In the Jamaica VM However more optimizations are required No backup GC has been implemented

207-9 October, 2002Increasing Memory Usage in Real-Time GC Benchmarks b= dividing objects into blocks bs= spreading the blocks r= using reference counting t= running thousand simulations (= more blocks in use)

217-9 October, 2002Increasing Memory Usage in Real-Time GC Future Work Full implementation RT-Mark compact Memory Usage Analysis Should critical systems use GC? Should critical systems use GC? Can you not explicitly deallocate all garbage if you can give an upper bound of memory usage? Can you not explicitly deallocate all garbage if you can give an upper bound of memory usage?

227-9 October, 2002Increasing Memory Usage in Real-Time GC Conclusion RT-Reference Counting drastically decrease the memory overhead of real- time systems with a GC The block size have a minor impact on the memory overhead

Increasing Memory Usage in Real-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet