Presentation: Cas Craven

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

1 Overview Assignment 5: hints  Garbage collection Assignment 4: solution.
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
Module 9: Virtual Memory
Module 10: Virtual Memory Background Demand Paging Performance of Demand Paging Page Replacement Page-Replacement Algorithms Allocation of Frames Thrashing.
Virtual Memory Background Demand Paging Performance of Demand Paging
Virtual Memory Introduction to Operating Systems: Module 9.
Segmentation and Paging Considerations
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.
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.
CS 153 Design of Operating Systems Spring 2015
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
Memory Management 2010.
Computer Organization and Architecture
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.
CS364 CH08 Operating System Support TECH Computer Science Operating System Overview Scheduling Memory Management Pentium II and PowerPC Memory Management.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Chapter 3 Memory Management: Virtual Memory
Review of Memory Management, Virtual Memory CS448.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Virtual Memory Virtual Memory is created to solve difficult memory management problems Data fragmentation in physical memory: Reuses blocks of memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Computer Systems Week 14: Memory Management Amanda Oddie.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
Runtime The optimized program is ready to run … What sorts of facilities are available at runtime.
® 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.
An Efficient, Incremental, Automatic Garbage Collector P. Deutsch and D. Bobrow Ivan JibajaCS 395T.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Virtual Memory. 2 Last Week Memory Management Increase degree of multiprogramming –Entire process needs to fit into memory Dynamic Linking and Loading.
Computer Architecture Lecture 12: Virtual Memory I
Chapter 7 Memory Management
Chapter 2 Memory and process management
Understanding Operating Systems Seventh Edition
CSE 120 Principles of Operating
Smalltalk Implementation: Memory Management and Garbage Collection
CS703 - Advanced Operating Systems
COMBINED PAGING AND SEGMENTATION
Chapter 9 – Real Memory Organization and Management
William Stallings Computer Organization and Architecture
CSI 400/500 Operating Systems Spring 2009
Main Memory Management
Module 9: Virtual Memory
Lecture 28: Virtual Memory-Address Translation
Chapter 9: Virtual-Memory Management
Lecture 27: Virtual Memory
5: Virtual Memory Background Demand Paging
Strategies for automatic memory management
List Processing in Real Time on a Serial Computer
CSE 451: Operating Systems Autumn 2005 Memory Management
Contents Memory types & memory hierarchy Virtual memory (VM)
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
CSC3050 – Computer Architecture
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Virtual Memory: Working Sets
Virtual Memory: Policies (Part II)
Module 9: Virtual Memory
COMP755 Advanced Operating Systems
Virtual Memory.
Reference Counting.
Virtual Memory 1 1.
Presentation transcript:

Presentation: Cas Craven Generation Scavenging: A Non-Disruptive High Performance Storage Reclamation Algorithm David Ungar et al. ACM Presentation: Cas Craven CS395T 2011 with Dr McKinley

Historical Perspective: Smalltalk-80 Early Personal Computers Developed at Xerox PARC, Released OO Language, WIMP GUI, Ease of Programming DOS and the IBM PC have been around for 4 years. First release of X window system on the MIT Project Athena mailing list, Apple releases the first Macintosh. Takaway: the PC is a new thing, and interactive environments with GUIs are shiny and new This all started with a Xerox PARC (Palo Alto Research Center) project to build an interactive PC, with kids in mind, circa mid to late 70s Smalltalk developed in this effort, released in 1980 to a few organizations including Berkley (then more widely in ’83) The initial implementation used reference counting to minimize the gc pause Berkley implemented Berkley Smalltalk on a Sun 1.5 workstation. Berkley is building a Smalltalk RISC machine and trying to improve performance of Berkley Smalltalk

Goals Interactive – minimize pause times Work well in a Virtual Memory machine Support circular structures Improve performance by minimizing CPU time used for memory management Xerox’s Smalltalk-80 used reference counting. 15-20% cpu time wasted, no circular structures.

Virtual Memory Segmentation Paging Divide main memory into variable-size blocks Segment swapped in can only replace segment of the same size or larger Segment table in main memory Paging Fixed size blocks Hardware support hides translation time in memory latency Segmentation With objects ranging from 24 bytes to 128k, and with 32-64k objects in a smalltalk system, a segment table for every object would be too large Paging Frequently referenced objects can become scattered over pages, but previous work showed a way for idle time reorganization to mitigate this

GC Algorithms Reference counting Mark-sweep [MKSMW] Copy-collector [Baker-78] Generational collection [Lieberman-Hewitt-83]

Reference Counting Overhead Additional overhead Partial solution: Deferred RC [Deutsch-Bobrow] Incomplete – circular structures not reclaimed

Tracing Algorithms Mark-sweep Scavenging Algorithms Large pause times Touches entire heap – lots of page faults Scavenging Algorithms Only touch live objects Baker’s Semispace Ballard’s modification of Baker’s algorithm: separate area for old objects Lieberman-Hewitt generational: not implemented Mark-Sweep: Pro: reclaims circular structures Con: high cpu overhead large pause times touches entire heap during sweep phase – large number of page faults Scavenging: Pro: only touch live objects, less thrashing, but still bad Ballard does better: don’t have to copy old objects so less overhead Cons: memory wasted Overhead incurred in creating, following, and correcting forwarding pointers can be reduced if not realtime Generational: Not yet implemented

Paging Dead Objects What if we just page all dead objects to disk? Back of envelope: Allocation rate likely exceeds disk bandwidth Storage will be exceeded sooner rather than later

Generation Scavenging New objects: NewSpace: Objects allocated here PastSurvivorSpace: holds survivors of previous scavenges FutureSurvivorSpace: empty during execution OldSpace: holds tenured objects Remembered Set: VM Registers plus old objects with references to new ones Transitive closure on this set finds all objects

Generation Scavenging Contents Volatile Objects Permantent Objects Residence New Space Old Space Space Size 200Kb (1) 940Kb Location Main Memory Demand Paged Created By Instantiation Tenuring Reclaimed By Scavenging Mark-Sweep (2) Reclaimed Every 16 sec 3-8 hours Reclamation Takes 0.160 sec 5 min 1: All three Spaces are 140Kb, but only NewSpace is resident. *SurvivorSpace may be paged out to disk and only 28Kb was used during testing 2: This is done offline, during idle time.

Generation Scavenging NewSpace PastSurvivor FutureSurvivor Registers OldSpace Remembered Set

Generation Scavenging NewSpace PastSurvivor FutureSurvivor Registers OldSpace Remembered Set

Generation Scavenging NewSpace FutureSurvivor PastSurvivor Registers OldSpace Remembered Set

Results Page it Immediate RC +compaction Deferred RC Mark-sweep   CPU Time (%) Dynamic Object Memory Paging I/Os Pause (s) Interval Page it ? 15Kb ~50/s Immediate RC 15-20 ∞ +compaction 1.3 60-1200 Deferred RC 11 40Kb 0.03 0.3 Mark-sweep 25-40 1900Kb 90/gc 4.5 74 Ballard 7% 2000Kb Gen. Scavenge 1.5-2.5 200Kb 1.2/s 0.38 30

Discussion Points Goals: Limit pause times to a fraction of a second Meshes well with virtual memory Reclaims circular structures Uses less than 2% of the CPU time

Discussion Points Experimental Methodology Berkley Benchmarks on a Sun 1.5 Single run of 4500k instructions Only count 28k of Past/Future SurvivorSpace Pathological allocation patterns?

Discussion Discounting of offline reclamation time Tenure threshold? No comparison against then-recent GC Mark-compact? Lieberman-Hewitt generational Modern perspective: Can it be parallel? Cache efficient?

Additional References Kay, Alan C. The Early History Of Smalltalk. ACM SIGPLAN Notices, Vol 28, No. 3. Mar 1993. Kaehler, Ted. http://tedkaehler.weather-dimensions.com/us/ted/resume/resume-oct03.html