Virtual Memory Operating Systems 1 Computer Science Dept Va Tech August 2007 ©2003-07 McQuain Page Buffering LRU and the Clock Algorithm are generally.

Slides:



Advertisements
Similar presentations
Chapters 7 & 8 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Advertisements

Page Replacement Algorithms
Chapter 3.3 : OS Policies for Virtual Memory
Virtual Memory 3 Fred Kuhns
Page-replacement policies On some standard algorithms for the management of resident virtual memory pages.
Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Virtual Memory II Chapter 8.
Virtual Memory: Page Replacement
Paging: Design Issues. Readings r Silbershatz et al: ,
Chapter 8 Virtual Memory
Operating Systems Prof. Navneet Goyal Department of Computer Science & Information Systems BITS, Pilani.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 38 Frame Allocation Read.
Chapter 101 Cleaning Policy When should a modified page be written out to disk?  Demand cleaning write page out only when its frame has been selected.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 15: Background Information for the VMWare ESX Memory Management.
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 Chapter 8.
Virtual Memory Characteristics of paging and segmentation
Virtual Memory Chapter 8.
Virtual Memory Chapter 8.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Virtual Memory Chapter 8.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Instructor: Umar KalimNUST Institute of Information Technology Operating Systems Revisiting Virtual Memory.
Virtual Memory (Chapter 8) Memory Management is an intimate and complex interrelationship between processor hardware and operating system software. Paging.
Virtual Memory Chapter 8.
CSI 400/500 Operating Systems Spring 2009 Lecture #9 – Paging and Segmentation in Virtual Memory Monday, March 2 nd and Wednesday, March 4 th, 2009.
1 Virtual Memory Chapter 8. 2 Process Execution n The OS brings into main memory only a few pieces of the program (including its starting point) n Each.
Chapter 8 Virtual Memory
OS Spring’04 Virtual Memory: Page Replacement Operating Systems Spring 2004.
A. Frank - P. Weisberg Operating Systems Virtual Memory Policies.
03/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
Chapter 8 Virtual Memory
Virtual Memory Chapter 8.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles Seventh Edition William Stallings.
1 Virtual Memory Chapter 9. 2 Resident Set Size n Fixed-allocation policy u Allocates a fixed number of frames that remains constant over time F The number.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Virtual memory concept Simple paging/ segmentation  pages or segments are loaded into frames that may not necessarily be.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Page Buffering, I. Pages to be replaced are kept in main memory for a while to guard against poorly performing replacement algorithms such as FIFO Two.
1 Page Replacement Algorithms. 2 Virtual Memory Management Fundamental issues : A Recap Key concept: Demand paging  Load pages into memory only when.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
Chapters 7 & 8 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College, Venice,
Project 4 Awards First Place Group 7 Samuel Bartlett Michael Phillips Norman Chen.
Virtual Memory Chapter 8.
ITEC 202 Operating Systems
Day 23 Virtual Memory.
Day 24 Virtual Memory.
Chapter 8 Virtual Memory
Module 9: Virtual Memory
Virtual Memory Chapter 8.
Lecture 40 Syed Mansoor Sarwar
5: Virtual Memory Background Demand Paging
Virtual Memory فصل هشتم.
Practical Session 8, Memory Management 2
Virtual Memory Chapter 8.
Virtual Memory: Policies (Part II)
Module 9: Virtual Memory
COMP755 Advanced Operating Systems
Practical Session 9, Memory Management continues
Presentation transcript:

Virtual Memory Operating Systems 1 Computer Science Dept Va Tech August 2007 © McQuain Page Buffering LRU and the Clock Algorithm are generally superior to FIFO, but they are more complex and involve more overhead. Also, it costs more to replace a modified page than an unmodified page. Page Buffering -basic strategy is FIFO, but… -page table entry is added to one of two lists: -free page list, if page has not been modified -modified page list, otherwise -try to keep at least a few frames free at all times -pages are not removed from memory until they MUST be overwritten -modified pages are replaced only if there is no free frame -used in VAX/VMS

Virtual Memory Operating Systems 2 Computer Science Dept Va Tech August 2007 © McQuain Resident Set Size How many frames should be allocated to a process? Fixed-allocation Gives a process a fixed number of pages within which to execute When a page fault occurs, one of the pages of that process must be replaced Variable-allocation Number of pages allocated to a process varies over the lifetime of the process

Virtual Memory Operating Systems 3 Computer Science Dept Va Tech August 2007 © McQuain Fixed Allocation, Local Scope Decide ahead of time the amount of allocation to give a process If allocation is too small, there will be a high page fault rate If allocation is too large there will be too few programs in main memory

Virtual Memory Operating Systems 4 Computer Science Dept Va Tech August 2007 © McQuain Variable Allocation, Global Scope Easiest to implement Adopted by many operating systems Operating system keeps list of free frames Free frame is added to resident set of process when a page fault occurs If no free frame, replaces one from another process

Virtual Memory Operating Systems 5 Computer Science Dept Va Tech August 2007 © McQuain Variable Allocation, Local Scope When new process added, allocate number of page frames based on application type, program request, or other criteria When page fault occurs, select page from among the resident set of the process that suffers the fault Reevaluate allocation from time to time

Virtual Memory Operating Systems 6 Computer Science Dept Va Tech August 2007 © McQuain Cleaning Policy Demand cleaning A page is written out only when it has been selected for replacement Precleaning Pages are written out in batches Best approach uses page buffering Replaced pages are placed in two lists Modified and unmodified Pages in the modified list are periodically written out in batches Pages in the unmodified list are either reclaimed if referenced again or lost when its frame is assigned to another page

Virtual Memory Operating Systems 7 Computer Science Dept Va Tech August 2007 © McQuain Load Control Determines the number of processes that will be resident in main memory Too few processes, many occasions when all processes will be blocked and much time will be spent in swapping Too many processes will lead to thrashing

Virtual Memory Operating Systems 8 Computer Science Dept Va Tech August 2007 © McQuain Process Suspension Lowest priority process Faulting process This process does not have its working set in main memory so it will be blocked anyway Last process activated This process is least likely to have its working set resident Process with smallest resident set This process requires the least future effort to reload Largest process Obtains the most free frames Process with the largest remaining execution window

Virtual Memory Operating Systems 9 Computer Science Dept Va Tech August 2007 © McQuain Linux Memory Management Page directory Page middle directory Page table