Complutense University, Madrid. Spain. * IMEC, Heverlee. Belgium. SEMINARIO 5-Marzo-2004 Garbage Collectors Refinement for New Dynamic Multimedia Applications.

Slides:



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

U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 MC 2 –Copying GC for Memory Constrained Environments Narendran Sachindran J. Eliot.
Automatic Memory Management Noam Rinetzky Schreiber 123A /seminar/seminar1415a.html.
CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
CMSC 330: Organization of Programming Languages Memory and Garbage Collection.
MC 2 : High Performance GC for Memory-Constrained Environments - Narendran Sachindran, J. Eliot B. Moss, Emery D. Berger Sowmiya Chocka Narayanan.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
By Jacob SeligmannSteffen Grarup Presented By Leon Gendler Incremental Mature Garbage Collection Using the Train Algorithm.
MC 2 : High Performance GC for Memory-Constrained Environments N. Sachindran, E. Moss, E. Berger Ivan JibajaCS 395T *Some of the graphs are from presentation.
Increasing Memory Usage in Real-Time GC Tobias Ritzau and Peter Fritzson Department of Computer and Information Science Linköpings universitet
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.
Free-Me: A Static Analysis for Individual Object Reclamation Samuel Z. Guyer Tufts University Kathryn S. McKinley University of Texas at Austin Daniel.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
0 Parallel and Concurrent Real-time Garbage Collection Part I: Overview and Memory Allocation Subsystem David F. Bacon T.J. Watson Research Center.
21 September 2005Rotor Capstone Workshop Parallel, Real-Time Garbage Collection Daniel Spoonhower Guy Blelloch, Robert Harper, David Swasey Carnegie Mellon.
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.
U NIVERSITY OF M ASSACHUSETTS Department of Computer Science Automatic Heap Sizing Ting Yang, Matthew Hertz Emery Berger, Eliot Moss University of Massachusetts.
JVM-1 Introduction to Java Virtual Machine. JVM-2 Outline Java Language, Java Virtual Machine and Java Platform Organization of Java Virtual Machine Garbage.
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Garbage Collection Without Paging Matthew Hertz, Yi Feng, Emery Berger University.
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.
1 Software Testing and Quality Assurance Lecture 31 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
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.
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.
Taking Off The Gloves With Reference Counting Immix
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.
Dynamic Object Sampling for Pretenuring Maria Jump Department of Computer Sciences The University of Texas at Austin Stephen M. Blackburn.
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.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science 1 Automatic Heap Sizing: Taking Real Memory into Account Ting Yang, Emery Berger,
Computer Science Department Daniel Frampton, David F. Bacon, Perry Cheng, and David Grove Australian National University Canberra ACT, Australia
September 11, 2003 Beltway: Getting Around GC Gridlock Steve Blackburn, Kathryn McKinley Richard Jones, Eliot Moss Modified by: Weiming Zhao Oct
Investigating the Effects of Using Different Nursery Sizing Policies on Performance Tony Guan, Witty Srisa-an, and Neo Jia Department of Computer Science.
380C lecture 19 Where are we & where we are going –Managed languages Dynamic compilation Inlining Garbage collection –Opportunity to improve data locality.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
1 Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT) Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss (UMass),
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.
CSE 598c – Virtual Machines Survey Proposal: Improving Performance for the JVM Sandra Rueda.
Consider Starting with 160 k of memory do: Starting with 160 k of memory do: Allocate p1 (50 k) Allocate p1 (50 k) Allocate p2 (30 k) Allocate p2 (30 k)
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.
Vertical Profiling : Understanding the Behavior of Object-Oriented Applications Sookmyung Women’s Univ. PsLab Sewon,Moon.
1 GC Advantage: Improving Program Locality Xianglong Huang, Zhenlin Wang, Stephen M Blackburn, Kathryn S McKinley, J Eliot B Moss, Perry Cheng.
® 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.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
1 The Garbage Collection Advantage: Improving Program Locality Xianglong Huang (UT), Stephen M Blackburn (ANU), Kathryn S McKinley (UT) J Eliot B Moss.
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.
Dynamic Compilation Vijay Janapa Reddi
Java 9: The Quest for Very Large Heaps
Seminar in automatic tools for analyzing programs with dynamic memory
David F. Bacon, Perry Cheng, and V.T. Rajan
Memory Management and Garbage Collection Hal Perkins Autumn 2011
Strategies for automatic memory management
Adaptive Code Unloading for Resource-Constrained JVMs
Memory Management Kathryn McKinley.
José A. Joao* Onur Mutlu‡ Yale N. Patt*
Garbage Collection Advantage: Improving Program Locality
Presentation transcript:

Complutense University, Madrid. Spain. * IMEC, Heverlee. Belgium. SEMINARIO 5-Marzo-2004 Garbage Collectors Refinement for New Dynamic Multimedia Applications on Embedded Systems Garbage Collectors Refinement for New Dynamic Multimedia Applications on Embedded Systems José M. Velasco, David Atienza, Francky Catthoor*, Francisco Tirado, Katzalin Olcoz, José M. Mendias

Seminario 5 Marzo Motivation  New application domains of embedded systems: Mobile terminals ( all sort of multimedia applications) Mobile terminals ( all sort of multimedia applications) AutomotiveAutomotive Game processors, Game processors, PDA, MP3 Player, etc.PDA, MP3 Player, etc.  Java is present everywhere. Java is a General Purpose OOP Language !!!!!! Java is a General Purpose OOP Language !!!!!!

Seminario 5 Marzo Java Popularity  Portability  JVM  OOP  Reusable Code  Dynamic Class Loading  Security  Multi-Thread  Automatic Memory Management

Seminario 5 Marzo Manual MM versus Automatic MM C++ malloc ( ) Free ( )  Destroy object Java Java { Class1 Object = new Class1 Class1 Object = new Class1 }  Take reference out from stack }  Take reference out from stack

Seminario 5 Marzo Automatic Memory Management Stack Pointer 2 Pointer 1 Heap Object 2 Object 1

Seminario 5 Marzo Automatic Memory Management Stack Pointer 1 Heap Unreacheable Object 1

Seminario 5 Marzo Automatic Memory Management Stack Pointer 3 Pointer 1 Heap Object 3 GARBAGE Object 1

Seminario 5 Marzo Manual MM versus Automatic MM Alive Internal Frag. External Frag. Alive Dead Internal Frag. C ++ Java

Seminario 5 Marzo Java

10 Virtual Machine Organization Compiler Subsystem Bytecodes.class JVM Dynamic class loading:.class Thread and synchronization Subsystem Run-Time Subsystem Memory Managment Subsystem

Seminario 5 Marzo Execution Profile

Seminario 5 Marzo A Mono-Application Virtual Machine JVM App. 1 App. 2 App. 3 Memory JVM JVM

Seminario 5 Marzo Automatic Memory Management  Allocation. It is the process of assigning resources of memory when requested by the program.  Garbage Collection. It is the automatic recycling of this dynamically allocated memory when it is no longer needed.  A lot of GC strategies  Reference Count, Mark&Sweep, M&S compact, Copying, Generational, Older First, Connectivity, Incremental,... All of them focused in one Objective.  Simplicity, performance, real time...All of them focused in one Objective.  Simplicity, performance, real time...  Why GC Refinements are important? Performance. Memory Footprint. Real Time requirements. Energy consumption. Tradeoff

Seminario 5 Marzo Presentation Overview  Garbage Collection Distinguishing Garbage.Distinguishing Garbage. Reclaiming Garbage.Reclaiming Garbage. AllocationAllocation Heap Organization.Heap Organization. Write BarriersWrite Barriers  The goal: JVM on Embedded SystemsJVM on Embedded Systems Concurrent Multimedia applicationsConcurrent Multimedia applications  Our proposal Multi-Application JVMMulti-Application JVM Custom GCsCustom GCs Adaptive techniquesAdaptive techniques  Future Work

Seminario 5 Marzo Distinguishing Garbage Phase.

Seminario 5 Marzo Distinguishing Garbage Phase. Reference Count. 2 StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Reference Count. 1 StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Reference Count. 0 StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Reference Count StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Reference Count StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Tracing Collection. StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Tracing Collection. StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Tracing Collection. StackHeap

Seminario 5 Marzo Distinguishing Garbage Phase. Tracing Collection. StackHeap

Seminario 5 Marzo Cache Behavior during Tracing Collection Cache Misses Misses Misses Misses

Seminario 5 Marzo Reclaiming Garbage Phase

Seminario 5 Marzo Reclaiming Garbage Phase. Tracing Collection. StackHeap Free lists

Seminario 5 Marzo Free Lists Pool

Seminario 5 Marzo Free Lists -- Fragmentation Pool

Seminario 5 Marzo Semispace Copying Policy Stack Pointer 2 Pointer1Semispace

Seminario 5 Marzo Semispace Copying Policy Stack Pointer 2 Pointer1Semispace

Seminario 5 Marzo Semispace Copying Policy Stack Pointer 2 Pointer1Allocation Semispace Free Semispace

Seminario 5 Marzo BumpPointer

Seminario 5 Marzo BumpPointer

Seminario 5 Marzo BumpPointer

Seminario 5 Marzo BumpPointer

Seminario 5 Marzo  Mark&Sweep. Free List.Free List. Fragmentation. Fragmentation. Poor Locality. Poor Locality. Small Heap size?. Small Heap size?.  Copying Policy Bump Pointer.Bump Pointer. Available memory / 2. Available memory / 2. High Cost for copying. High Cost for copying. Big Heap Size?. Big Heap Size?.

Seminario 5 Marzo Execution Mode  Stop-the-World. Parallel.  Concurrent.  Incremental Program Program ProgramProgram Program ProgramGC GC GC GCGCGC ProgramProgramProgram ProgramProgramProgram

Seminario 5 Marzo Barriers Collected SubHeap SubHeap Not Collected SubHeap Remember

Seminario 5 Marzo Heap Organization Copying policy Mark&SweepMark&Sweep Large Objects Heap

Seminario 5 Marzo Mark&Sweep

Seminario 5 Marzo SemiSpace Copying Policy

Seminario 5 Marzo Copy + Mark&Sweep

Seminario 5 Marzo Generational Garbage Collection Strategy Generational Collection. Weak Generational Hypothesis.Weak Generational Hypothesis. Java Objects Lifetime. Java Objects Lifetime. AdultYoungQuasi-Inmortal 60% 60%10%30% Java Distribution Gauss Distribution

Seminario 5 Marzo Generational Collection  The memory is divided into multiple subheaps with varying scavenge frequencies  Objects begin their life in the higher collection frequency area.  The objects that survive a number of collections move to a less frequently collected area.  This collector avoids to copy repeatedly the inmortal or quasi-inmortal objects. Mature Nursery Two generations Heap

Seminario 5 Marzo Generational – Mature  Mark&Sweep Policy

Seminario 5 Marzo Generational – Mature  Copying Policy

Seminario 5 Marzo Pauses Distribution through Execution Time

Seminario 5 Marzo Minimum Program Utilization

Seminario 5 Marzo Java on Embedded Systems Minimum Heap Size  Max Number of living ObjectsMinimum Heap Size  Max Number of living Objects Copying  x2 Copying  x2 Mark&Sweep  + Frag Mark&Sweep  + Frag Soft Real Time  PerformanceSoft Real Time  Performance Pause Time  MPU Pause Time  MPU Write Barriers Write Barriers  Incremental  Concurrent Tracing  Cache Misses Tracing  Cache Misses Mono-Application Virtual MachineMono-Application Virtual Machine

Seminario 5 Marzo Embedded Systems  Multimedia Applications  Internal Dynamism Unpredictable data behavior.Unpredictable data behavior.  External Dynamism Several applications working concurrently.Several applications working concurrently. Different scenarios of available memory.Different scenarios of available memory. How can we handle these dynamic systems?

Seminario 5 Marzo Our proposal

Seminario 5 Marzo A Multi-Application Virtual Machine JVM App. 1 App. 2 App. 3 Min Min x 3 Min x 1.5 Memory

Seminario 5 Marzo A Multi-Application Virtual Machine JVM App. 1 App. 2 App. 3 Min x 2.5 Min Min x 2 Memory

Seminario 5 Marzo A Multi-Application Virtual Machine JVM App. 1 App. 2 App. 3 Min Min x 1.5 Min x 4 Memory

Seminario 5 Marzo Overview of Our Approach In this paper we propose a new method that allows the design of custom GCs for new dynamic applications (e.g. multimedia), taking into account the application behavior and the constraints of the final embedded device. - Analysis (mainly profiling) of the application - Characterizing DM behaviour pattern

Seminario 5 Marzo Overview of Our Approach Application Design Search Space  All possible decisions to select an optimal GC This Search Space is formalized as a set of orthogonal trees with basic interdependencies a set of orthogonal trees with basic interdependencies

Seminario 5 Marzo Overview of Our Approach Application We propose a new system-level method to explore the vast design search space of possible garbage collector mechanisms, Our long term Goal is to develop an automatic tool to traverse the trees and produce a tailor made GC for a specific multimedia application with a tradeoff between performance, memory footprint, real time requirements and energy consumption. Our long term Goal is to develop an automatic tool to traverse the trees and produce a tailor made GC for a specific multimedia application with a tradeoff between performance, memory footprint, real time requirements and energy consumption.

Seminario 5 Marzo Overview of Our Approach Application GCRefinements As a result of our Refinements As a result of our Refinements a set of modules that form a custom GC a set of modules that form a custom GC These modules are linked to the Java Virtual Machine that will run over the final device

Seminario 5 Marzo Overview of Our Approach Application GCRefinements Linked Modules Linked Modules The custom GC can be a mixed hardware/ Software implementation. The custom GC can be a mixed hardware/ Software implementation. - Write Barriers. - Real-Time Restrictions. -Hardware Design Tool.

Seminario 5 Marzo Overview of Our Approach Application GCRefinements Linked Modules Linked Modules Dedicated Hardware And finally, a convenient custom GC design for a specific embedded system without a complex engineering process.

Seminario 5 Marzo Overview of Our Approach – Matisse Project (IMEC) Application GCRefinements Linked Modules Linked Modules Dedicated Hardware MicroProcessorFPGA

Seminario 5 Marzo Summary of our proposed approach Main objective: - New design method to design custom GCs for new dynamic applications (e.g. multimedia), taking into account the application behavior and the constraints of the final embedded device. Phases: - Analysis (mainly profiling) of the application - taking into account the application behavior and the constraints of the final embedded device. - Systematic exploration of possible GC solutions from structured (orthogonalized) design space, taking into account the application behavior and the constraints of the final embedded device. - Implementation of promising GC solutions and empirical evaluation of them.

Seminario 5 Marzo Our Design Space  Design Search Space of Orthogonal Decisions for Garbage Collectors AllocationAllocation Distinguishing Garbage.Distinguishing Garbage. Reclaiming Garbage.Reclaiming Garbage. Heap Organization.Heap Organization. Write BarriersWrite Barriers  Any Combination of decisions in Orthogonal trees  Valid Solution  All possible solutions in the search space should be spanned by a combination of leaves in the orthogonal trees.

Seminario 5 Marzo The different zones distinguished by our custom GCs A-ZoneB-ZoneC-Zone

Seminario 5 Marzo Experimental Results.

Seminario 5 Marzo Experimental Results.

Seminario 5 Marzo Adaptive Techniques

Seminario 5 Marzo Minimum Heap Size  Different Benchmarks Minimum Heap Size  Different Benchmarks

Seminario 5 Marzo Appel Collector

Seminario 5 Marzo Adaptive Management of Reserved Space

Seminario 5 Marzo Dynamic Management of Nursery Organization. Jack.

Seminario 5 Marzo Dynamic Strategies  Dynamic “Worst Case” strategy.  Dynamic “Average” strategy.

Seminario 5 Marzo Mispredictions

Seminario 5 Marzo Nursery Threshold

Seminario 5 Marzo Experimental Results  Metrics: Amount of Copied memory.Amount of Copied memory. Number of Collections.Number of Collections. Global Collection Time.Global Collection Time. Execution Time.Execution Time.

Seminario 5 Marzo Amount of copied memory Jess Jack

Seminario 5 Marzo Summary

Seminario 5 Marzo Reduction in the number of collections. Jess

Seminario 5 Marzo Summary

Seminario 5 Marzo Total Collection Time SpeedUp

Seminario 5 Marzo Summary

Seminario 5 Marzo Execution Time SpeedUp

Seminario 5 Marzo Summary

Seminario 5 Marzo Conclusions Generational Collector that Dynamically:Generational Collector that Dynamically: Readjust the reserved space in the nursery. Readjust the reserved space in the nursery. Changes the nursery threshold that triggers a Full Heap Collection. Changes the nursery threshold that triggers a Full Heap Collection. Novel Field of Research.Novel Field of Research. Can be used jointly with others strategies based in Copying Policy.Can be used jointly with others strategies based in Copying Policy.

Seminario 5 Marzo Current work  Incremental Copy

Seminario 5 Marzo Write Barriers  Remembered Sets LOS Root Set

Seminario 5 Marzo Write Barriers  Remembered Sets LOS Root Set

Seminario 5 Marzo Is Not Complete !!! Is Not Complete !!!

Seminario 5 Marzo Is Not Complete !!!

Seminario 5 Marzo Adaptive  Incremental

Seminario 5 Marzo Future Work – BrainStorming Heap CompressionHeap Compression Selective Selective  Object fields  References  Generations Compiler AnalysisCompiler Analysis Objects  Used Fields Objects  Used Fields Fixed Regions  Stack Fixed Regions  Stack Data Connectivity Data Connectivity Hardware SupportHardware Support Write Barriers Write Barriers Compression Compression Tracing Tracing On-Line ProfilingOn-Line Profiling Class behavior Class behavior Data Connectivity behavior Data Connectivity behavior Gehringer & Chang Mushroom (Wolczko&Williams) L1 L2Co-processorReferenceCounting L1Nursery TaggedMemoryFixed regions regions