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

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

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

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

Managed runtimes & garbage collection

Garbage Collection. Hwansoo Han

Simple Garbage Collection and Fast Allocation Andrew W. Appel

CS 345. Garbage Collection. Vitaly Shmatikov. slide 1

Java Performance Tuning

Garbage Collection Techniques

Lecture 13: Garbage Collection

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

Brief survey of garbage collection algorithms

Programming Language Implementation

CMSC 330: Organization of Programming Languages

Memory management has always involved tradeoffs between numerous optimization possibilities: Schemes to manage problem fall into roughly two camps

Myths and Realities: The Performance Impact of Garbage Collection

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

Lecture 15 Garbage Collection

Run-Time Environments/Garbage Collection

CMSC 330: Organization of Programming Languages

Garbage Collection. Vyacheslav Egorov

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

Garbage Collection Algorithms. Ganesh Bikshandi

BROWN UNIVERSITY Department of Computer Science Master's Thesis CS-90-M16

JVM Memory Model and GC

Heap Compression for Memory-Constrained Java

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

A new Mono GC. Paolo Molaro October 25, 2006

The C4 Collector. Or: the Application memory wall will remain until compaction is solved. Gil Tene Balaji Iyengar Michael Wolf

CS399 New Beginnings. Jonathan Walpole

The Garbage-First Garbage Collector

Intro to Garbage Collection in Smalltalk

Concurrent Garbage Collection

Java & Coherence Simon Cook - Sales Consultant, FMW for Financial Services

Chapter 8 Virtual Memory

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Comparative Performance Evaluation. Garbage Collection Algorithms. Benjamin G. Zorn. University of California. Berkeley, California 94720

Hard Real-Time Garbage Collection in Java Virtual Machines

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

CS577 Modern Language Processors. Spring 2018 Lecture Garbage Collection

Machine-Independent Virtual Memory Management for Paged June Uniprocessor 1st, 2010and Multiproce 1 / 15

MEMORY MANAGEMENT. Jo, Heeseung

Memory Management. Jo, Heeseung

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

Memory Management. Goals of Memory Management. Mechanism. Policies

Exploiting the Efficiency of Generational Algorithms for Hardware-Supported Real-Time Garbage Collection

Preview. Memory Management

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

Memory - Paging. Copyright : University of Illinois CS 241 Staff 1

Garbage Collection (2) Advanced Operating Systems Lecture 9

Today. Adding Memory Does adding memory always reduce the number of page faults? FIFO: Adding Memory with LRU. Last Class: Demand Paged Virtual Memory

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Virtual Memory. Chapter 8

Dynamic Selection of Application-Specific Garbage Collectors

Implementation Garbage Collection

Reducing the Latency of a Real-time Garbage Collector. in the Appel-Ellis-Li real-time garbage collector be proportional only to the

CSE 120 Principles of Operating Systems Spring 2017

Ulterior Reference Counting: Fast Garbage Collection without a Long Wait

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

Chapter 3 Memory Management: Virtual Memory

Garbage Collecting Reactive Real-Time Systems

Virtual to physical address translation

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

Recall from Tuesday. Our solution to fragmentation is to split up a process s address space into smaller chunks. Physical Memory OS.

Computer Architecture. Lecture 8: Virtual Memory

Comparing Mark-and-sweep and Stop-and-copy Garbage Collection

Course: Operating Systems Instructor: M Umair. M Umair

CSE 120 Principles of Operating Systems

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Cycle Tracing. Presented by: Siddharth Tiwary

Today. Process Memory Layout. CSCI 4061 Introduction to Operating Systems. Where does the memory come from?

Java Garbage Collector Performance Measurements

Page Size Page Size Design Issues

Exploiting the Behavior of Generational Garbage Collector

Do Your GC Logs Speak To You

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

Operating Systems (1DT020 & 1TT802) Lecture 9 Memory Management : Demand paging & page replacement. Léon Mugwaneza

Habanero Extreme Scale Software Research Project

Operating Systems, Fall Lecture 5 1. Overhead due to page table and internal fragmentation. Tbl 8.2 [Stal05] 4.

Operating Systems, Fall Lecture 5 1

Memory Management william stallings, maurizio pizzonia - sistemi operativi

Garbage Collection. Steven R. Bagley

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

Memory Management (Chaper 4, Tanenbaum)

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

Reducing Generational Copy Reserve Overhead with Fallback Compaction

Fundamentals of GC Tuning. Charlie Hunt JVM & Performance Junkie

CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

Garbage Collection. Weiyuan Li

Towards Garbage Collection Modeling

Heap Management. Heap Allocation

1. Creates the illusion of an address space much larger than the physical memory

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

Virtual Memory. Today. Segmentation Paging A good, if common example

Memory Management Topics. CS 537 Lecture 11 Memory. Virtualizing Resources

Transistor: Digital Building Blocks

ABSTRACT. Until the advent of generational garbage collection, page faults caused by garbage collection

High Performance Managed Languages. Martin Thompson

CS 31: Intro to Systems Virtual Memory. Kevin Webb Swarthmore College November 15, 2018

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Transcription:

Generation scavenging: A non-disruptive high-performance storage reclamation algorithm By David Ungar Presented by Donald Nguyen February 9, 2009 1 / 13

Context The year was 1984... Microcomputers, interactive programming environments Design interactive Smalltalk-80 system for Sun workstation Main technical hurdles: Limit pause times Play well with virtual memory 2 / 13

Players Virtual memory Segmentation Paging Popular GC algorithms Reference counting Mark-sweep [MKSMW] Copy-collector [Baker-78] Generational collection [Lieberman-Hewitt-83] 3 / 13

Virtual Memory Segmentation Paging Main memory divided into blocks of potentially unequal lengths Typically typed into program and data segments When a segment is swapped in, it can only replace a segment of the same size or larger (fragmentation) Fixed-size blocks 4 / 13

Reference counting High overhead because additional action must be done for all objects Immediate reference counting Deferred reference counting [Deutsch-Bobrow] Ignore references from local variables Precludes reclamation during execution Question: Reference counting today? Different overheads today? What about William s anecdote about only using reference countable data structures? 5 / 13

Tracing Algorithms Mark-sweep Mark phase inspects all live objects, sweep phase modifies all dead objects Large pause times Scavenging algorithms Psuedo real-time; overhead to install and check forwarding pointers, maintain remembered set Baker s semispace algorithm Ballard s modification of Baker s algorithm Create separate area for old objects 600 KB for old objects, 512 KB object table, 2 x 1 MB semispaces Lieberman-Hewitt s generational algorithm, not implemented 6 / 13

Straw Man OS already has virtual memory, leverage abstraction of infinite memory One object per segment/page Use VM to keep live objects in main memory Dead objects will be moved to secondary storage Problems? 7 / 13

Straw Man OS already has virtual memory, leverage abstraction of infinite memory One object per segment/page Use VM to keep live objects in main memory Dead objects will be moved to secondary storage Problems? For segmentation, object variance: [24, 128,000] bytes (mean: 50) and number: 32,000 64,000 objects Object fragmentation 7 / 13

Straw Man OS already has virtual memory, leverage abstraction of infinite memory Problems? One object per segment/page Use VM to keep live objects in main memory Dead objects will be moved to secondary storage For segmentation, object variance: [24, 128,000] bytes (mean: 50) and number: 32,000 64,000 objects Object fragmentation Allocation rates: 70 bytes 1 object 1 object 9000 bytecodes 80 instructions1 second = 7800 bytes second BS-II second 7800 bytes Dorado second 13 BS-II seconds 100 MB disk 20 minutes disk 1 Appel reports 1 object every 30 instructions 7 / 13

Design Space Keep main memory footprint low: 1.5 3 MB Low pause time, but not necessarily real-time Reduce page faults Reduce CPU overhead 8 / 13

Generational Scavenging 9 / 13

Generational Scavenging Novelties: Regions of different sizes: NewSpace (140 KB), *SurvivorSpace (28 KB each) OldSpace not resident in main memory Tenuring: after a while a surviving object is promoted to OldSpace. Similarities with Ballard s algorithm: Young and old generations Copies live objects Reclaims old objects offline Differences with other generational algorithms: Divides new space into three regions instead of two Not incremental, no checks needed on loads 10 / 13

Results CPU Time (%) Main Memory (KB) Paging I/O Pause time (s) Pause interval (s) page it? 15 50/s imm. ref. count 15 20 15? 0 compaction 1.3 60 1200 def. ref. count 11 40? 0.030 0.30 compaction 1.3 60 1200 mark-sweep 25 40 1900 90/gc 4.5 74 Ballard 7 2000 0 0 Gen. Scavenge 1.5 2.5 200 1.2/s 0.38 30 Table 1: Summary of reclamation strategies 11 / 13

Is This Still Relevant Now? Revisiting the claims: Limit pause times to a fraction of a second Requires no hardware support Meshes well with virtual memory Reclaims circular structures Uses less than 2% of the CPU time Is the experimental methodology still sound? Should old objects be kept in secondary storage? 12 / 13

Breaking or Enforcing Abstractions If computer science is generally about making abstractions and extracting performance about breaking them, how should we view Ungar s work? A case for a wider interface between runtime system and OS? An isolated issue related to implementing a managed memory system? What memory management techniques can help or hinder virtual memory systems and vice versa? E.g., Appel recommends mapping the memory just before the free space (assuming allocation goes from high to low) to an inaccessible page so that the out of memory test can be converted to a page fault 13 / 13