Chapter 9 Virtual Memory Bernard Chen 2007 Spring.

Slides:



Advertisements
Similar presentations
Chapter 10: Virtual Memory
Advertisements

Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Chapter 9: Virtual Memory
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 36 Virtual Memory Read.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 13: Main Memory (Chapter 8)
Virtual Memory Management G. Anuradha Ref:- Galvin.
9.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Memory OSC: Chapter 9. Demand Paging Copy-on-Write Page Replacement.
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.
Virtual Memory Management
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Virtual Memory.
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 9: Virtual Memory Background.
Chapter 10: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Chapter 10: Virtual Memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual Memory.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Chapter 9: Virtual Memory. Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Virtual Memory.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Cosc 4740 Chapter 8 Virtual Memory. Background Code needs to be in memory to execute, but entire program rarely used –Error code, unusual routines, large.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
CS212: OPERATING SYSTEM Lecture 6: Virtual-Memory Management 1 Computer Science Department.
Computer Studies (AL) Memory Management Virtual Memory I.
Silberschatz, Galvin and Gagne Operating System Concepts Chapter 9: Virtual Memory.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Memory.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
9.1 Silberschatz, Galvin and Gagne ©2003 Operating System Concepts Chapter 9: Virtual-Memory Management Background Demand Paging Page Replacement Allocation.
Virtual Memory. Background Virtual memory is a technique that allows execution of processes that may not be completely in the physical memory. Virtual.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
CS307 Operating Systems Virtual Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2012.
Virtual Memory Various memory management techniques have been discussed. All these strategies have the same goal: to keep many processes in memory simultaneously.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
Lecture 19 Virtual Memory Demand Paging. Background Virtual memory – separation of user logical memory from physical memory. –Only part of the program.
Virtual Memory The address used by a programmer will be called a virtual address or logical address. An address in main memory is called a physical address.
Chapter 9: Virtual-Memory Management. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 9: Virtual-Memory Management 9.1 Background.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual-Memory Management.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Virtual Memory.
Topic 8 (Textbook - Chapter 9) Virtual Memory
SLC/VER1.0/OS CONCEPTS/OCT'99
Virtual Memory CSSE 332 Operating Systems
UNIT–IV: Memory Management
Chapter 9: Virtual Memory – Part I
Chapter 9: Virtual Memory
Chapter 9: Virtual Memory
Operating Systems Virtual Memory Alok Kumar Jagadev.
Review.
Module 9: Virtual Memory
O.S Lecture 13 Virtual Memory.
Chapter 9: Virtual-Memory Management
Operating Systems Lecture November 2018.
5: Virtual Memory Background Demand Paging
Chapter 9: Virtual Memory
Chapter 9: Virtual Memory
Contents Memory types & memory hierarchy Virtual memory (VM)
Module 9: Virtual Memory
Chapter 9: Virtual Memory
Chapter 8 & 9 Main Memory and Virtual Memory
Module IV Memory Organization.
Presentation transcript:

Chapter 9 Virtual Memory Bernard Chen 2007 Spring

Virtual Memory Only part of the program needs to be in memory for execution Logical address space can therefore be much larger than physical address space Allows for more efficient process creation Virtual memory can be implemented via: Demand paging Demand segmentation

Advantages A program no longer be constrained by the amount of physical memory that is available Since each user program could take less physical memory, more programs could run at the same time Less I/O would be needed to load or swap each user program into memory, so it will be faster

Virtual Memory

Demand Paging In stead of loading whole program into memory, demand paging is an alternative strategy to initially load pages only as they are needed Lazy Swapper: Pages are only loaded when they are demanded during program execution Swapper that deals with pages is a pager

Transfer of a page memory to continuous disk space

Demand paging basic concepts When a process is to be swapped in, the pager guesses which pages will be used before the process is swapped out again. Instead of swapping in a whole process, the pager brings only those necessary pages into memory

Valid Valid-Invalid Bit With each page table entry a valid–invalid bit is associated (v=> in-memory, i =>not-in-memory) Initially valid–invalid bit is set to i on all entries During address translation, if valid–invalid bit in page table entry is i => page fault

Valid Valid-Invalid Bit Example

Page Fault

Performance of Demand Paging Page Fault Rate 0 ≤p≤1.0 if p= 0 no page faults if p= 1, every reference is a fault Effective Access Time (EAT)= (1-p)*ma + p*page fault time

Performance of Demand Paging

If we want performance degradation to be less than 10%, we need 220 > 200+7,999,800*p 20>7,999,800*p P< It is important to keep the page-fault rate low in a demand-paging system

9.4 Page Replacement What if there is no free frame? Page replacement –find some page in memory, but not really in use, swap it out In this case, same page may be brought into memory several times

Basic Page Replacement

Page Replacement

Page Replacement Algorithms Goal: Want lowest page-fault rate Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number of page faults on that string In all our examples, the reference string is 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5

FIFO When a page must be replaced, the oldest page is chosen In all our examples, the reference string is 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 3 frame 4 frame

FIFO Algorithm