NCHU System & Network Lab Lab 12 Page Replacement Algorithm.

Slides:



Advertisements
Similar presentations
9.4 Page Replacement What if there is no free frame?
Advertisements

Chapter 101 The LRU Policy Replaces the page that has not been referenced for the longest time in the past By the principle of locality, this would be.
Module 10: Virtual Memory
Chapter 10: Virtual Memory
Scribe for 7 th April 2014 Page Replacement Algorithms Payal Priyadarshini 11CS30023.
Chapter 9 Virtual Memory Bernard Chen 2007 Spring.
Virtual Memory Management G. Anuradha Ref:- Galvin.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 38 Frame Allocation Read.
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 ©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
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
CS 104 Introduction to Computer Science and Graphics Problems
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/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
NCHU System & Network Lab Lab 10 Message Queue and Shared Memory.
Maninder Kaur VIRTUAL MEMORY 24-Nov
CSS430 Virtual Memory Textbook Ch9
Virtual Memory.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Background Virtual memory –
Operating System Concepts 7th Edition Abraham SilBerschatz Peter Baer Galvin Greg Gagne Prerequisite: CSE212.
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 Process Creation Page Replacement.
Operating Systems CMPSC 473 Virtual Memory Management (3) November – Lecture 20 Instructor: Bhuvan Urgaonkar.
NCHU System & Network Lab Lab 11 Memory Mapped File.
By Andrew Yee. Virtual Memory Memory Management What is Page Replacement?
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Page Replacement Allocation of.
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.
Introduction to Operating Systems J. H. Wang Sep. 15, 2010.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Page Replacement Algorithms and Simulation Neville Allen.
1 Project: Page Replacement Algorithms Lubomir Bic.
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.
Lecture Topics: 11/24 Sharing Pages Demand Paging (and alternative) Page Replacement –optimal algorithm –implementable algorithms.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
NCHU System & Network Lab Lab 14 File and Directory.
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.
CS 149: Operating Systems March 5 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 9: Virtual-Memory Management. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 9: Virtual-Memory Management 9.1 Background.
NCHU System & Network Lab Lab #6 Thread Management Operating System Lab.
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.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
Chapter 9: Virtual Memory. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Background Virtual memory – separation of user logical memory.
Memory Management (2).
EECE.4810/EECE.5730 Operating Systems
Chapter 9: Virtual-Memory Management
Text Illustrations in PPT Chapter 5 CPU Scheduling
Lecture 39 Syed Mansoor Sarwar
Lab 5 Process Control Operating System Lab.
CS 140 Lecture Notes: Demand Paging
Practical Session 8, Memory Management 2
CS 140 Lecture Notes: Demand Paging
Operating Systems CMPSC 473
Lab 10 Paging.
Module IV Memory Organization.
Chapter 9: Virtual Memory CSS503 Systems Programming
Practical Session 9, Memory Management continues
Module IV Memory Organization.
Lab #9 Semaphores Operating System Lab.
Presentation transcript:

NCHU System & Network Lab Lab 12 Page Replacement Algorithm

NCHU System & Network Lab Introduction Why do we need page replacement algorithm ? –When page fault occur and there are no free memory frame, we need an algorithm to choose a victim frame. What is page fault ? –Process wants to access the page but the page isn’t placed in main memory.

NCHU System & Network Lab Page Fault a b c d e f 3v i8vii6v f c a abcd ef logical memory page table physical memory secondary memory frame valid-invalid bit

NCHU System & Network Lab Page Replacement Algorithm First In, First Out (FIFO) –Simplest –Associates with each page the time when it was brought into memory. –victim page = oldest page –Just use a FIFO queue

NCHU System & Network Lab FIFO Reference string a b c d a c a a b c a b a c b a c b d first in first out c a d c a d c a d c a d b a d b a c page frames

NCHU System & Network Lab Example A program that show FIFO replacement algorithm process Input –A file that has a reference string. Output –Page replacement process. –Number of page fault times.

NCHU System & Network Lab

Page Replacement Algorithm Least Recently Used (LRU) –Associates with each page the time of that page’s last use –Victim page = the page that has not been used for the longest period of time –Use counters or stack

NCHU System & Network Lab LRU (stack) Reference string a b c d a c a a b c a b a c b a d c b least-recently used a d c c d a a c d a c d b a c c b a page frames

NCHU System & Network Lab LRU (counter) Reference string a b c d a c a a b c a0a0 b1 a0 b1 c2 d3 b1 c2 d3 a4 c2 d3 a4 c5 d3 a6 c5 d3 a7 c5 b8 a7 c5 b8 a7 c9 page frames least-recently used

NCHU System & Network Lab Lab A program that show LRU replacement algorithm process Input –A file that has a reference string. Output –Page replacement process. –Number of page fault times.

NCHU System & Network Lab Reference Advanced Programming in the UNIX Environment 2nd Author : Richard Stevens, Stephen A.Rago, Publisher : Addison-Wesley Beginning Linux Programming Author : Richard Stones, Neil MatthewPublisher : Wrox Operating System Concepts 6th edition Author : Abraham Silberschatz, Peter Baer Galvin, Greg Gagne Publisher : John Wiley & Sons, inc.