Module IV Memory Organization.

Slides:



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

CS 241 Spring 2007 System Programming 1 Memory Replacement Policies Lecture 32 Klara Nahrstedt.
Page Replacement Algorithms
4.4 Page replacement algorithms
Page Replacement Algorithms
Cache and Virtual Memory Replacement Algorithms
Virtual Memory 3 Fred Kuhns
Module 10: Virtual Memory
Scribe for 7 th April 2014 Page Replacement Algorithms Payal Priyadarshini 11CS30023.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 38 Frame Allocation Read.
03/31/2004CSCI 315 Operating Systems Design1 Allocation of Frames & Thrashing (Virtual Memory)
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 Introduction to Operating Systems: Module 9.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management – 4 Page Replacement Algorithms CS 342 – Operating Systems.
Memory Problems Prof. Sin-Min Lee Department of Mathematics and Computer Sciences.
LRU Replacement Policy Counters Method Example
Technical University of Lodz Department of Microelectronics and Computer Science Elements of high performance microprocessor architecture Virtual memory.
03/29/2004CSCI 315 Operating Systems Design1 Page Replacement Algorithms (Virtual Memory)
Maninder Kaur VIRTUAL MEMORY 24-Nov
Virtual Memory.
O RERATıNG S YSTEM LESSON 10 MEMORY MANAGEMENT II 1.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Simulation of Memory Management Using Paging Mechanism in Operating Systems Tarek M. Sobh and Yanchun Liu Presented by: Bei Wang University of Bridgeport.
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.
Computer Architecture Lecture 26 Fasih ur Rehman.
Operating Systems CMPSC 473 Virtual Memory Management (3) November – Lecture 20 Instructor: Bhuvan Urgaonkar.
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.
Homework Assignment #3 J. H. Wang Nov. 19, Homework #3 Chap.7: 7.5, 7.10 Chap.8: 8.6, 8.10 Chap.9: 9.3, 9.6 Due: two weeks (Dec. 3, 2009)
1 Project: Page Replacement Algorithms Lubomir Bic.
CSC 360, Instructor: Kui Wu Memory Management II: Virtual Memory.
Computer Architecture Foundations for Graduate Level Students.
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.
Saket Mengle Paging refers to the process of managing program access to virtual memory pages that do not currently reside in RAM.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 9: Virtual Memory.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Virtual Memory By CS147 Maheshpriya Venkata. Agenda Review Cache Memory Virtual Memory Paging Segmentation Configuration Of Virtual Memory Cache Memory.
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
1.Why we need page replacement? 2.Basic page replacement technique. 3.Different type of page replacement algorithm and their examples.
Virtual Memory Operating Systems 1 Computer Science Dept Va Tech August 2007 © McQuain Page Buffering LRU and the Clock Algorithm are generally.
CSCI206 - Computer Organization & Programming
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Logistics Homework 5 will be out this evening, due 3:09pm 4/14
Computer Architecture
Dr. Bernard Chen Ph.D. University of Central Arkansas
Virtual Memory © 2004, D. J. Foreman.
Module 9: Virtual Memory
Assignment 4 – (a) Consider a symmetric MP with two processors and a cache invalidate write-back cache. Each block corresponds to two words in memory.
CGS 3763 Operating Systems Concepts Spring 2013
Lecture 39 Syed Mansoor Sarwar
Lecture 40 Syed Mansoor Sarwar
5: Virtual Memory Background Demand Paging
CPSC 457 Operating Systems
Chap. 12 Memory Organization
So far in memory management…
Page Replacement FIFO, LIFO, LRU, NUR, Second chance
Operating Systems CMPSC 473
Today’s agenda High-level memory management (additional materials + Ch10, Module VIII) page replacement algorithms CS354-Fall2018.
Module IV Memory Organization.
Virtual Memory: Policies (Part II)
Virtual Memory © 2004, D. J. Foreman.
Module 9: Virtual Memory
Virtual Memory.
Sarah Diesburg Operating Systems CS 3430
Clock Algorithm Example
Module IV Memory Organization.
Presentation transcript:

Module IV Memory Organization

LFU Page Replacement Algorithm It involves keeping track of the number of times a page is referenced in memory.  Implementation: Assign a counter to every block that is loaded into the cache. Each time a reference is made the counter is incremented When the cache reaches capacity, system will search for the page with lowest counter and remove it from the cache

LFU Page Replacement Example Consider the reference string : 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 for a memory with three frames.

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1)

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1)

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1) 1 1(1)

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1) 1 1(1) 2 2(1)

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1) 1 1(1) 2 2(1) 0(2)

7, 0, 1, 2, 0, 3,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, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1) 1 1(1) 2 2(1) 0(2) 3 3(1) 0(3) 4 4(1) 0(4) 3(2) Page Frame Hit -1 2 3(2) 0(4) 2(2) 1 1(1) 2(3) 0(5) 1(2) 7 7(1) 0(6) Hit Ratio = 9/20 No. of Page Faults = 11

7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7, 0, 1 Page Frame Hit -1 7 7(1) 0(1) 1 1(1) 2 2(1) 0(2) 3 3(1) 0(3) 4 4(1) 0(4) 3(2) Page Frame Hit -1 2 3(2) 0(4) 2(2) 1 1(1) 2(3) 0(5) 1(2) 7 7(1) 0(6) Hit Ratio = 9/20 No. of Page Faults = 11