VIRTUAL MEMORY Demand Paging ARNEL F. CARATING MSIT – NA 2006-00154-2M.

Slides:



Advertisements
Similar presentations
Chapter 3 Memory Management
Advertisements

9: Virtual Memory1 Jerry Breecher OPERATING SYSTEMS VIRTUAL MEMORY.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 36 Virtual Memory Read.
Virtual Memory Management G. Anuradha Ref:- Galvin.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
Virtual Memory Management
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
VIRTUAL MEMORY WHY VIRTUAL MEMORY?
Lecture 11: Memory Management
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.
VIRTUAL MEMORY. Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-7 Memory Management (1) Department of Computer Science and Software.
Operating Systems Chapter 8
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Chapter 4 Storage Management (Memory Management).
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Page 110/20/2015 CSE 30341: Operating Systems Principles So far…  Page  Fixed size pages solve page allocation problem (and external fragmentation) 
CS212: OPERATING SYSTEM Lecture 6: Virtual-Memory Management 1 Computer Science Department.
6 Memory Management and Processor Management Management of Resources Measure of Effectiveness – On most modern computers, the operating system serves.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
Computer Studies (AL) Memory Management Virtual Memory I.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally VIRTUALMEMORY.
Silberschatz, Galvin and Gagne Operating System Concepts Chapter 9: Virtual Memory.
Chapter 4 Memory Management Virtual Memory.
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.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
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.
1 Virtual Memory. Cache memory: provides illusion of very high speed Virtual memory: provides illusion of very large size Main memory: reasonable cost,
OPERATING SYSTEMS VIRTUAL MEMORY.
Lecture 19 Virtual Memory Demand Paging. Background Virtual memory – separation of user logical memory from physical memory. –Only part of the program.
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.
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.
SLC/VER1.0/OS CONCEPTS/OCT'99
Memory Management.
Virtual Memory CSSE 332 Operating Systems
Chapter 9: Virtual Memory – Part I
Chapter 9: Virtual Memory
OPERATING SYSTEMS VIRTUAL MEMORY
CSI 400/500 Operating Systems Spring 2009
Chapter 9: Virtual-Memory Management
Operating Systems Lecture November 2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Computer Architecture
Module IV Memory Organization.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
Chapter 9: Virtual Memory
Chapter 9: Virtual Memory
Chapter 6 Virtual Memory
Contents Memory types & memory hierarchy Virtual memory (VM)
Lecture 37 Syed Mansoor Sarwar
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Virtual Memory.
Module IV Memory Organization.
Presentation transcript:

VIRTUAL MEMORY Demand Paging ARNEL F. CARATING MSIT – NA M

VIRTUAL MEMORY Definitions Virtual memory The conceptual separation of user logical memory from physical memory. Thus we can have large virtual memory on a small physical memory.

VIRTUAL MEMORY Definitions Demand paging When a page is touched, bring it from secondary to main memory. Overlays Laying of code data on the same logical addresses - this is the reuse of logical memory. Useful when the program is in phases or when logical address space is small. Dynamic loadingA routine is loaded only when it's called.

VIRTUAL MEMORY Demand Paging When a page is referenced, either as code execution or data access, and that page isn’t in memory, then get the page from disk and re-execute the statement. Here’s migration between memory and disk

VIRTUAL MEMORY Demand Paging One instruction may require several pages. For example, a block move of data. May page fault part way through an operation – may have to undo what was done. Example: an instruction crosses a page boundary. Time to service page faults demands that they happen only infrequently. Note here that the page table requires a “resident” bit showing that page is/isn’t in memory. Book uses “valid” bit to indicate residency. An “invalid” page is that way because a legal page isn’t resident or because the address is illegal. It makes more sense to have two bits – one indicating that the page is legal (valid) and a second to show that the page is in memory. Frame #valid invalid bit page table ent bit Frame # Resid valid- invalid

VIRTUAL MEMORY Demand Paging STEPS IN HANDLING A PAGE FAULT 1. The process has touched a page not currently in memory. 2. Check an internal table for the target process to determine if the reference was valid (do this in hardware.) 3. If page valid, but page not resident, try to get it from secondary storage. 4. Find a free frame; a page of physical memory not currently in use. (May need to free up a page.) 5. Schedule a disk operation to read the desired page into the newly allocated frame. 6. When memory is filled, modify the page table to show the page is now resident. 7. Restart the instruction that failed Do these steps using the figure you can see on the next page.

VIRTUAL MEMORY Demand Paging

REQUIREMENTS FOR DEMAND PAGING (HARDWARE AND SOFTWARE ) INCLUDE: Page table mechanism Secondary storage (disk or network mechanism). Software support for fault handlers and page tables. Architectural rules concerning restarting of instructions. (For instance, block moves across faulted pages.)

VIRTUAL MEMORY Demand Paging effective_access_time= ( 1 - p )*memory_access_time +p*page_fault_time. PERFORMANCE OF DEMAND PAGING We are interested in the effective access time: a combination of “normal” and “paged” accesses. It’s important to keep fraction of faults to a minimum. It fault ratio is “p”, then Calculate the time to do a fault as shown in the text. fault time= 10 milliseconds (why) normal access= 100 nanoseconds(why) How do these fit in the formula?

VIRTUAL MEMORY Demand Paging The Picture When All Pages Are Not In Memory Some of the pages belonging to this process are in memory, and some are on the disk. A bit in the page table tells where to find the page.