Exploiting Prolific Types for Memory Management and Optimizations By Yefim Shuf et al.

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.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Garbage Collection What is garbage and how can we deal with it?
CSC 213 – Large Scale Programming. Today’s Goals  Consider what new does & how Java works  What are traditional means of managing memory?  Why did.
Garbage Collection  records not reachable  reclaim to allow reuse  performed by runtime system (support programs linked with the compiled code) (support.
Compiler construction in4020 – lecture 12 Koen Langendoen Delft University of Technology The Netherlands.
Allocating Memory.
Chapter 7 Memory Management
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
NUMA Tuning for Java Server Applications Mustafa M. Tikir.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
Memory Management Professor Yihjia Tsai Tamkang University.
Generational Stack Collection And Profile driven Pretenuring Perry Cheng Robert Harper Peter Lee Presented By Moti Alperovitch
File System Implementation CSCI 444/544 Operating Systems Fall 2008.
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Connectivity-Based Garbage Collection Presenter Feng Xian Author Martin Hirzel, et.al Published in OOPSLA’2003.
CS 104 Introduction to Computer Science and Graphics Problems
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management 2010.
Run time vs. Compile time
1 PATH: Page Access Tracking Hardware to Improve Memory Management Reza Azimi, Livio Soares, Michael Stumm, Tom Walsh, and Angela Demke Brown University.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
Age-Oriented Concurrent Garbage Collection Harel Paz, Erez Petrank – Technion, Israel Steve Blackburn – ANU, Australia April 05 Compiler Construction Scotland.
Jangwoo Shin Garbage Collection for Real-Time Java.
1 Run time vs. Compile time The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage.
Using Generational Garbage Collection To Implement Cache- conscious Data Placement Trishul M. Chilimbi & James R. Larus מציג : ראובן ביק.
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.
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.
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.
Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum.
Chapter 7 Memory Management
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.
Java Virtual Machine Case Study on the Design of JikesRVM.
Subject: Operating System.
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.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
1 Recursive Data Structure Profiling Easwaran Raman David I. August Princeton University.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
Lecture 7 Page 1 CS 111 Summer 2013 Dynamic Domain Allocation A concept covered in a previous lecture We’ll just review it here Domains are regions of.
® 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.
CS412/413 Introduction to Compilers and Translators April 21, 1999 Lecture 30: Garbage collection.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Reference Counting. Reference Counting vs. Tracing Advantages ✔ Immediate ✔ Object-local ✔ Overhead distributed ✔ Very simple Trivial implementation for.
Memory Management Chapter 5 Advanced Operating System.
1 Memory Management Adapted From Modern Operating Systems, Andrew S. Tanenbaum.
Eliminating External Fragmentation in a Non-Moving Garbage Collector for Java Author: Fridtjof Siebert, CASES 2000 Michael Sallas Object-Oriented Languages.
Memory Management Chapter 7.
Garbage Collection What is garbage and how can we deal with it?
Memory Management 6/20/ :27 PM
Dynamic Memory Allocation
File System Structure How do I organize a disk into a file system?
26 - File Systems.
Concepts of programming languages
Optimizing Malloc and Free
Strategies for automatic memory management
Adaptive Code Unloading for Resource-Constrained JVMs
Linked Lists.
Chapter 12 Memory Management
Reference Counting.
Garbage Collection What is garbage and how can we deal with it?
Presentation transcript:

Exploiting Prolific Types for Memory Management and Optimizations By Yefim Shuf et al.

Roadmap What is prolific types? –Properties of prolific types Applications –Type-based garbage collection –Reducing memory consumed by objects –Object co-allocation –Locality-based traversal Conclusions

Prolific Types Observation: –Relatively few object types usually account for a large percentage of objects (and heap space) These frequently instantiated types are prolific types Others are non-prolific types

Identifying Prolific Types Offline profiling –Dump information in a file Adaptive approach –Collect info during execution –Sampling Compile-time –May be possible

Checking a Variable for Prolific Type Given “T o” –Object o is prolific if all subclasses of T are prolific –Need class hierarchy analysis Check added at compile time –Handle dynamic loading A simple heuristic –Prolific types are likely leaves or close to leaves Treat all children of prolific types as prolific

Application 1 :Type-based Memory Management Objects of prolific types have short lifetimes –Resemble nature: offspring of prolific species are often short- lived Heap space partitioned into two regions –P-region: objects of prolific types –NP-region: objects of non-prolific types Collection –Perform frequent minor collection only in the P-region – In frequent full collection –Survivors of P-region collection stay in P-region Compared to generation collection –Write barriers needed to remember pointer from NP-region to P- region

Additional Advantages Compile-time write barrier elimination –Eliminate barrier that are not pointing from NP to P P-region Collection Processing –Only need to scan pointers to P-region Methods return two reference list –One full list –One partial list: references to prolific objects

Results: write barrier

Results: Throughput

Results: GC Times

Application 2: Short Type Pointers Observation: The number of prolific types is small –Mostly <= 16 Application –Shorten object headers –Using a 4-bit field to encode TIB The value is an index to the table of real TIBs

Results: statistics on prolific types

Results: Space Saving

Application 3: Object Co-allocation Properties –Objects of prolific types tend to access together –The large number of prolific objects denote potential benefit Co-allocate objects of prolific types –Improve spatial locality –Reduce GC times with improved GC-time locality –Reduce memory fragmentation Objects born together tend to die together

The Co-allocation Algorithm Create a directed graph –Nodes: types –Edges: from a (source) type to a type of the source’s reference field P-edge: prolific type to prolific type NP-edge: non prolific type to non prolific-type Others Co-allocation –Partition the graph into clusters –Each cluster is a set of nodes linked by P-edges –When one node (representative node) of a cluster is allocated, reserve enough space for other nodes in cluster –In practice, each cluster consists of two nodes

Locality-based Traversal Divide heap into chunks Visit the objects in to same chunk before those in other chunks –Improve GC locality –Can improve locality when combined with a copy collector

The Locality-based Traversal Algorithm

Implementation Issues Choice of chunk size –No bigger than the physical memory of a process Which chunk to collect first? –Last chunk allocated (may still in cache) Which pointer to choose from LP? –Choose an object close to the one visited recently Which chunk next? –With most reachable objects by sampling –A pointer into the chunk closest to the current chunk

Results: non-copy GC

Results: Copying GC

Conclusions Prolific type based GC perform better than a generational GC With encode prolific types, heap space reduced Proliflic objects co-allocation improve performance with non-copying GC Locality-based GC traversal has positive impacts on copying GC