Heap Compression for Memory-Constrained Java

Similar documents
Heap Compression for Memory-Constrained Java Environments Λ

Garbage Collection. Hwansoo Han

Object Duplication for Improving Reliability

Myths and Realities: The Performance Impact of Garbage Collection

Run-Time Environments/Garbage Collection

Garbage Collection Algorithms. Ganesh Bikshandi

Energy vs. Memory Trade-Offs on Energy-and- Memory Constraint Embedded JVM

Implementation Garbage Collection

Impact of Java Compressed Heap on Mobile/Wireless Communication

Garbage Collection Techniques

PennBench: A Benchmark Suite for Embedded Java

JamaicaVM Java for Embedded Realtime Systems

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

Tuning Garbage Collection for Reducing Memory System Energy in an Embedded Java Environment

Reference Counting. Reference counting: a way to know whether a record has other users

CS 345. Garbage Collection. Vitaly Shmatikov. slide 1

Lecture 15 Garbage Collection

Name, Scope, and Binding. Outline [1]

Mark-Sweep and Mark-Compact GC

Garbage Collection. Weiyuan Li

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

Managed runtimes & garbage collection

A new Mono GC. Paolo Molaro October 25, 2006

Compiler Construction D7011E

Memory Allocation. Static Allocation. Dynamic Allocation. Dynamic Storage Allocation. CS 414: Operating Systems Spring 2008

Exploiting the Behavior of Generational Garbage Collector

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

Tracking Object Life Cycle for Leakage Energy Optimization Λ

Java On Steroids: Sun s High-Performance Java Implementation. History

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

Reference Counting. Reference counting: a way to know whether a record has other users

Automatic Memory Management

Hard Real-Time Garbage Collection in Java Virtual Machines

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

CS577 Modern Language Processors. Spring 2018 Lecture Garbage Collection

Dynamic Storage Allocation

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

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

Testing in Resource Constrained Execution Environments

CSE 4/521 Introduction to Operating Systems. Lecture 23 File System Implementation II (Allocation Methods, Free-Space Management) Summer 2018

Habanero Extreme Scale Software Research Project

CS 4120 Lecture 37 Memory Management 28 November 2011 Lecturer: Andrew Myers

Java Performance Tuning

CSE 373 OCTOBER 23 RD MEMORY AND HARDWARE

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

Memory Management william stallings, maurizio pizzonia - sistemi operativi

Heap Management. Heap Allocation

I J C S I E International Science Press

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

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

MEMORY MANAGEMENT HEAP, STACK AND GARBAGE COLLECTION

G Programming Languages - Fall 2012

Simple Garbage Collection and Fast Allocation Andrew W. Appel

Automatic Garbage Collection

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

CS140 Operating Systems and Systems Programming Final Exam

Deallocation Mechanisms. User-controlled Deallocation. Automatic Garbage Collection

Garbage Collection (1)

Run-time Environments -Part 3

CS842: Automatic Memory Management and Garbage Collection. Mark and sweep

LANGUAGE RUNTIME NON-VOLATILE RAM AWARE SWAPPING

Boosting the Priority of Garbage: Scheduling Collection on Heterogeneous Multicore Processors

Java Garbage Collector Performance Measurements

RAM, Design Space, Examples. January Winter Term 2008/09 Gerd Liefländer Universität Karlsruhe (TH), System Architecture Group

Garbage Collection. Steven R. Bagley

High-Level Language VMs

Dynamic Selection of Application-Specific Garbage Collectors

Programming Languages Third Edition. Chapter 10 Control II Procedures and Environments

IBM Research Report. Efficient Memory Management for Long-Lived Objects

Lecture 15 Advanced Garbage Collection

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

Progress & Challenges for Virtual Memory Management Kathryn S. McKinley

Lesson 2 Dissecting Memory Problems

Space and Time-Efficient Hashing of Garbage-Collected Objects

CSc 453 Interpreters & Interpretation

The Garbage-First Garbage Collector

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

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

Lecture Notes on Garbage Collection

Generation scavenging: A non-disruptive high-performance storage reclamation algorithm By David Ungar

Hazard Pointers. Number of threads unbounded time to check hazard pointers also unbounded! difficult dynamic bookkeeping! thread B - hp1 - hp2

Algorithms for Dynamic Memory Management (236780) Lecture 4. Lecturer: Erez Petrank

CS61C Midterm Review on C & Memory Management

JVM Performance Tuning with respect to Garbage Collection(GC) policies for WebSphere Application Server V6.1 - Part 1

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

Garbage Collection (2) Advanced Operating Systems Lecture 9

CS61C : Machine Structures

CA341 - Comparative Programming Languages

Parallel Memory Defragmentation on a GPU

CS61C : Machine Structures

CS61C : Machine Structures

Memory Management 3/29/14 21:38

Practical Java Card bytecode compression 1

Run-time Environments - 3

Project. there are a couple of 3 person teams. a new drop with new type checking is coming. regroup or see me or forever hold your peace

Robust Memory Management Schemes

Introduction to Computer Systems. Exam 2. April 10, Notes and calculators are permitted, but not computers.

File System Implementation. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

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

Free-Me: A Static Analysis for Automatic Individual Object Reclamation

Transcription:

Heap Compression for Memory-Constrained Java CSE Department, PSU G. Chen M. Kandemir N. Vijaykrishnan M. J. Irwin Sun Microsystems B. Mathiske M. Wolczko OOPSLA 03 October 26-30 2003

Overview PROBLEM: Typical portable devices support less than 1MB of memory (2003) SOLUTION: Reduce execution heap size of current embedded JVMs Extending existing garbage collection methods to allow for Heap Compression: When current execution cannot continue, compress heap Lazy Allocation: Exploit limited usage of large object components

Results Summary Compared to Mark-Compact Garbage Collection Analysis of ten applications suitable for mobile devices One method reduced heap demand by 35% on average (16-54%) Introduced less than 2% performance degradation due to compression/decompression

Garbage Collection Overview Existing Methods Mark-Sweep (MS) Phase One: (Mark) Traverse reference tree, marks objects reachable from root. Phase Two: (Sweep) Scans heap, put all unmarked objects into a free-table Results in "Fragmentation Problem" -- live objects and free space interleaved. Requires heap size larger than application footprint

Garbage Collection Overview Existing Methods Mark-Compact (MC) Addresses the "Fragmentation Problem Slides all marked objects to one end of the heap Requires updates to all object references

Mark-Compact-Compress (MCC) Allows application to run with heap smaller than footprint Mark Phase: Same as existing, but counts size of live objects. Allocate new object based on free space Object smaller: Proceed without compression Object larger: Compress all live objects on the heap

Mark-Compact-Compress (MCC) Zero Removal Compression Based on observation; large portion of memory locations contain only zeros Compression / Decompression Overhead Overhead not incurred frequently Heap demand occurs during a very short period of execution Decompression cost amortized over multiple accesses. Many objects never accessed after compression

Compression Algorithm Selection Any compression/decompression algorithm will work For best results, algorithm should satisfy Compressor should have good compression ratio Compression / decompression should be fast Neither compressor nor decompressor should require large working area

Compression Heap Objects 0: unmarked; 1:marked 0: uncompressed 0: unmarked; 1:marked 0: uncompressed Type Size Pointer to the Handle Contents of the Object Type Bitmap Compressed Size Pointer to the Handle Original Size Extra Bitmap Extra Bitmap Non-zero Bytes of the Object Uncompressed object Compressed object Each bit in the bitmap corresponds to a byte of the objects data in the uncompressed format. 0-bit indicates a zero byte; not stored in the compressed format 1-bit indicates non-zero byte; contents stored in non-zero bytes When required: Scan the entire heap, compress all uncompressed objects.

Decompression Object Access Allocate free block size of uncompressed object. (invoke GC if required) Decompress the object Update the pointer in the handle The compressed object is marked for GC

Decompression Mark Phase Collector traverses reference tree Visit to compressed object Check object class for referenced fields If required, decompress, retrieve contents Fields are decompressed one-by-one Decompressed data is discarded Never invokes allocation

Lazy Allocation Different portions of an object allocated on-demand Only applied to large arrays to minimize runtime overhead MCCL garbage collection

Creation of subobjects Decompression of large objects Inefficient for a few fields Break large objects into (1KB max) subobjects Currently only arrays are broken down

Minimum Heap Sizes without out-of-memory exceptions

Compressions / Decompressions

Runtime Overhead with minimum heap for MC * Bar on left is MCCL, bar on the right is MC