Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by: Khanh Nguyen.

Slides:



Advertisements
Similar presentations
Lecture 10: Heap Management CS 540 GMU Spring 2009.
Advertisements

Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by Phil Howard.
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Virtual Memory Primitives for User Programs Andrew Appel and Kai Li Princeton U. Appears in ASPLOS.
Garbage Collection  records not reachable  reclaim to allow reuse  performed by runtime system (support programs linked with the compiled code) (support.
5. Memory Management From: Chapter 5, Modern Compiler Design, by Dick Grunt et al.
Garbage Collection CSCI 2720 Spring Static vs. Dynamic Allocation Early versions of Fortran –All memory was static C –Mix of static and dynamic.
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.
1 The Compressor: Concurrent, Incremental and Parallel Compaction. Haim Kermany and Erez Petrank Technion – Israel Institute of Technology.
COMP 3221: Microprocessors and Embedded Systems Lectures 27: Virtual Memory - III Lecturer: Hui Wu Session 2, 2005 Modified.
G Robert Grimm New York University Cool Pet Tricks with… …Virtual Memory.
Garbage Collection Mooly Sagiv html://
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
Architectural Support for OS March 29, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Generational Stack Collection And Profile driven Pretenuring Perry Cheng Robert Harper Peter Lee Presented By Moti Alperovitch
Virtual Memory Art Munson CS614 Presentation February 10, 2004.
Memory Subsystem Performance of Programs using Coping Garbage Collection Authers: Amer Diwan David Traditi Eliot Moss Presented by: Ronen Shabo.
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Memory Management 2010.
Incremental Garbage Collection
An Adaptive, Region-based Allocator for Java Feng Qian & Laurie Hendren 2002.
Garbage collection (& Midterm Topics) David Walker COS 320.
Answers to the VM Problems Spring First question A computer has 32 bit addresses and a virtual memory with a page size of 8 kilobytes.  How many.
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.
SEG Advanced Software Design and Reengineering TOPIC L Garbage Collection Algorithms.
Memory-Mapped Files & Unified VM System Vivek Pai.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
80386DX.
© 2004, D. J. Foreman 1 Memory Management. © 2004, D. J. Foreman 2 Building a Module -1  Compiler ■ generates references for function addresses may be.
CS533 - Concepts of Operating Systems Virtual Memory Primitives for User Programs Presentation by David Florey.
Virtual Memory CS Introduction to Operating Systems.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
Incremental Garbage Collection Uwe Kern 23. Januar 2002
Chapter 4 Memory Management Virtual 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.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
UniProcessor Garbage Collection Techniques Paul R. Wilson University of Texas Presented By Naomi Sapir Tel-Aviv University.
Paging (continued) & Caching CS-3013 A-term Paging (continued) & Caching CS-3013 Operating Systems A-term 2008 (Slides include materials from Modern.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
M. Accetta, R. Baron, W. Bolosky, D. Golub, R. Rashid, A. Tevanian, and M. Young MACH: A New Kernel Foundation for UNIX Development Presenter: Wei-Lwun.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Processes and Virtual Memory
Virtual Memory Various memory management techniques have been discussed. All these strategies have the same goal: to keep many processes in memory simultaneously.
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.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
CS412/413 Introduction to Compilers and Translators April 21, 1999 Lecture 30: Garbage collection.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
Simple Generational GC Andrew W. Appel (Practice and Experience, February 1989) Rudy Kaplan Depena CS 395T: Memory Management February 9, 2009.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Translation Lookaside Buffer
Lecture 11 Virtual Memory
Memory Management (2).
Jonathan Walpole Computer Science Portland State University
Virtual Memory CSSE 332 Operating Systems
Operating Systems CMPSC 473
Paging COMP 755.
Modeling Page Replacement Algorithms
Memory Management © 2004, D. J. Foreman.
Swapping Segmented paging allows us to have non-contiguous allocations
Chapter 9: Virtual-Memory Management
Modeling Page Replacement Algorithms
Fast Communication and User Level Parallelism
Architectural Support for OS
Chapter 12 Memory Management
Architectural Support for OS
Presentation transcript:

Virtual Memory Primitives for User Programs Andrew W. Appel and Kai Li Presented by: Khanh Nguyen

Plan of Attack Virtual Memory Primitives Virtual Memory Applications  Shared Virtual Memory  Concurrent Garbage Collection  Generational Garbage Collection  Heap Overflow Detection Applications Patterns VM Primitive Performance

Virtual Memory Primitives TRAP: handle page-fault traps in user mode PROT1: decrease the accessibility of a page PROTN: decrease the accessibility of N pages UNPROT: increase the accessibility of a page DIRTY: return a list of dirtied pages since the previous call. MAP2: map the physical page at two different virtual addresses, at different levels of protection, in the same address space.

Shared Virtual Memory Useful for splitting a task into multiple computers working together over the network.

Shared Virtual Memory (cont.) Each processor has its own memory Each memory basically represents the big cache for the shared virtual memory. Read-only page can have copies residing in the physical memories of many processors at the same time. When a processor trying to access to the page, but it’s not on the its memory, it will trigger a fault that invoke Mapping manager to go out the network to get the up-to-date page. If it’s a write access, Mapping Manager send out a message to invalidate all other copies. Uses PROT1, TRAP, and UNPROT

Concurrent Garbage Collection Base on Baker’s algorithm Divides the memory heap into from-space and to-space At the beginning of a collection, all objects are in the from-space and to-space is empty. Collectors copy any reachable object from from-space to to-space. Any remaining objects are garbage. Remove garbage and Flip the space around. Any new allocate object will be created in to-space. Any access to the old object that is still referenced to the from-space will be move to-space. This is done by inserting instruction to check every fetch or virtual memory Uses PROTN, TRAP, UNPROT

Generational Garbage Collection Two properties of dynamically allocated object  Younger records are much more likely to die soon than older records.  Younger records tend to point to older records. Allocated objects are kept in area based on their age. This area is called generation Collector usually collect in the youngest generation. If it finds any object in the youngest generation that is pointed by the older generation, it will keep that object. The only way to find if a young generation is pointed by an older generation, we need to check every assignment operation. Or protect the older generations with “no write” flag. Uses PROTN, TRAP, UNPROT, or DIRTY

Heap Overflow Detection Ordinarily, heap overflow is detected by compare and conditional-branch on every memory allocation operation Problem: overhead Similar to stack overflow detection Mark the top page with “no access” Use PROT1 and TRAP Doesn’t use UNPROT because the protection will never be removed.

Application Patterns Algorithm NameProtection Shared Virtual MemoryPROT1 Concurrent GCPROTN Generational GCPROTN Heap Overflow DetectionPROT1

VM Primitive Performance