# Lecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne

Save this PDF as:

Size: px
Start display at page:

Download "Lecture 17. Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne"

## Transcription

1 Lecture 17 Edited from slides for Operating System Concepts by Silberschatz, Galvin, Gagne

2 Page Replacement Algorithms Last Lecture: FIFO Optimal Page Replacement LRU LRU Approximation Additional-Reference-Bits Algorithm Second-Chance Algorithm This Lecture: Counting-Based Page Replacement

3 Counting Algorithms Keep a counter of the number of references that have been made to each page LFU (Least Frequently Used) Algorithm: replaces page with smallest count MFU (Most Frequently Used) Algorithm: based on the argument that the page with the smallest count was probably just brought in and has yet to be used

4 Problem You have devised a new page replacement algorithm that you think may be optimal. However, in some cases, Belady s anomaly occurs. Is the new algorithm optimal? Explain.

5 Allocation of Frames Each process needs minimum number of pages Example: IBM pages to handle SS MOVE instruction: instruction is 6 bytes, might span 2 pages 2 pages to handle from 2 pages to handle to Two major allocation schemes fixed allocation (equal vs. proportional) priority allocation

6 Fixed Allocation: Equal Equal allocation For example, if there are 100 frames and 5 processes, give each process 20 frames.

7 Fixed Allocation: Proportional Proportional allocation Allocate according to the size of process s S = s m = total number of a i i = size of process i = allocation for p i p i frames si = m S m = 64 s s a a = 10 = 127 = =

8 Fixed Allocation: Proportional Proportional allocation Allocate according to the size of process s S = s a i i = size of process i m = total number of = allocation for m = 64 s s a a = 10 = 127 p i p i frames si = m S 10 = =

9 Priority Allocation Use a proportional allocation scheme using priorities rather than size If process P i generates a page fault, select for replacement one of its frames select for replacement a frame from a process with lower priority number

10 Global vs. Local Allocation Global replacement process selects a replacement frame from the set of all frames; one process can take a frame from another Local replacement each process selects from only its own set of allocated frames

11 Thrashing Thrashing process is busy swapping pages, instead of execution High page-fault rate =>low CPU utilization => OS thinks that it needs to increase the degree of multiprogramming => another process added to the system

12 Demand Paging and Thrashing Prevent Thrashing by providing enough frames to process Locality model Process migrates from one locality to another Localities may overlap Why does thrashing occur? Σ size of locality > total memory size

13 Locality In A Memory-Reference Pattern

14 Working-set model

15 Page-Fault Frequency Scheme Establish acceptable page-fault rate If actual rate too low, process loses frame If actual rate too high, process gains frame

16 Working Sets and Page Fault Rates

17 Other Issues -- Prepaging Prepaging To reduce the large number of page faults that occurs at process startup Prepage all or some of the pages a process will need, before they are referenced But if prepaged pages are unused, I/O and memory was wasted Assume s pages are prepaged and α of the pages is used Is cost of s * α save pages faults > or < than the cost of prepaging s * (1- α) unnecessary pages? α near zero prepaging loses

18 Other Issues Page Size Page size selection must take into consideration: fragmentation table size I/O overhead locality

19 Other Issues Program Structure Program structure Int[128,128] data; Each row is stored in one page (row major) Program 1 for (j = 0; j <128; j++) for (i = 0; i < 128; i++) data[i,j] = 0; 128 x 128 = 16,384 page faults Program 2 for (i = 0; i < 128; i++) for (j = 0; j < 128; j++) data[i,j] = 0; 128 page faults

20 Other Issues I/O interlock I/O Interlock Pages must sometimes be locked into memory Consider I/O - Pages that are used for copying a file from a device must be locked from being selected for eviction by a page replacement algorithm

21 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU

22 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk

23 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming

24 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming Decrease the degree of multiprogramming

25 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming Decrease the degree of multiprogramming Install more main memory

26 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming Decrease the degree of multiprogramming Install more main memory Install a faster hard disk

27 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming Decrease the degree of multiprogramming Install more main memory Install a faster hard disk Add prepaging to the page-fetch algorithms

28 Problem Demand-paging system with following time-measured utilizations CPU 20% Paging disk 97.7% Other I/O devices 5% Comment on improved CPU utilization given if you Install a faster CPU Install a bigger paging disk Increase the degree of multiprogramming Decrease the degree of multiprogramming Install more main memory Install a faster hard disk Add prepaging to the page-fetch algorithms Increase the page size

29 See you next time

### Background. Virtual Memory (2/2) Demand Paging Example. First-In-First-Out (FIFO) Algorithm. Page Replacement Algorithms. Performance of Demand Paging

Virtual Memory (/) Background Page Replacement Allocation of Frames Thrashing Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in memory

### Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

### instruction is 6 bytes, might span 2 pages 2 pages to handle from 2 pages to handle to Two major allocation schemes

Allocation of Frames How should the OS distribute the frames among the various processes? Each process needs minimum number of pages - at least the minimum number of pages required for a single assembly

### Page Replacement. 3/9/07 CSE 30341: Operating Systems Principles

Page Replacement page 1 Page Replacement Algorithms Want lowest page-fault rate Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Background Demand Paging Chapter 9: Virtual Memory Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

### Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

### Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture were based on those Operating Systems Concepts, 9th ed., by Silberschatz, Galvin, and

### Chapter 10: Virtual Memory. Background

Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples 10.1 Background Virtual memory separation of user logical

### Virtual Memory. Virtual Memory. Demand Paging. valid-invalid bit. Virtual Memory Larger than Physical Memory

Virtual Memory Virtual Memory CSCI Operating Systems Design Department of Computer Science Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in

### Chapter 10: Virtual Memory. Background. Demand Paging. Valid-Invalid Bit. Virtual Memory That is Larger Than Physical Memory

Chapter 0: Virtual Memory Background Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples Virtual memory separation of user logical memory

### Where are we in the course?

Previous Lectures Memory Management Approaches Allocate contiguous memory for the whole process Use paging (map fixed size logical pages to physical frames) Use segmentation (user s view of address space

### Background. Demand Paging. valid-invalid bit. Tevfik Koşar. CSC Operating Systems Spring 2007

CSC 0 - Operating Systems Spring 007 Lecture - XIII Virtual Memory Tevfik Koşar Background Virtual memory separation of user logical memory from physical memory. Only part of the program needs to be in

### Principles of Operating Systems

Principles of Operating Systems Lecture 21-23 - Virtual Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian,

### Page Replacement Algorithms

Page Replacement Algorithms MIN, OPT (optimal) RANDOM evict random page FIFO (first-in, first-out) give every page equal residency LRU (least-recently used) MRU (most-recently used) 1 9.1 Silberschatz,

### Operating System Concepts

Chapter 9: Virtual-Memory Management 9.1 Silberschatz, Galvin and Gagne 2005 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

### Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating

### Chapters 9 & 10: Memory Management and Virtual Memory

Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection

### CS370 Operating Systems

CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 33 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How does the virtual

### Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

### Chapter 9: Virtual-Memory Management. Operating System Concepts 8 th Edition,

Chapter 9: Virtual-Memory Management, Silberschatz, Galvin and Gagne 2009 Chapter 9: Virtual-Memory Management Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped

### Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

### OPERATING SYSTEM. Chapter 9: Virtual Memory

OPERATING SYSTEM Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory

### Chapter 9: Virtual Memory. Operating System Concepts 9th Edition

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations

### Virtual Memory B: Objec5ves

Virtual Memory B: Objec5ves Benefits of a virtual memory system" Demand paging, page-replacement algorithms, and allocation of page frames" The working-set model" Relationship between shared memory and

### Virtual Memory COMPSCI 386

Virtual Memory COMPSCI 386 Motivation An instruction to be executed must be in physical memory, but there may not be enough space for all ready processes. Typically the entire program is not needed. Exception

### Swapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has

Swapping Active processes use more physical memory than system has Operating Systems I Address Binding can be fixed or relocatable at runtime Swap out P P Virtual Memory OS Backing Store (Swap Space) Main

### CS6401- Operating System UNIT-III STORAGE MANAGEMENT

UNIT-III STORAGE MANAGEMENT Memory Management: Background In general, to rum a program, it must be brought into memory. Input queue collection of processes on the disk that are waiting to be brought into

### Virtual Memory: Page Replacement. CSSE 332 Operating Systems Rose-Hulman Institute of Technology

Virtual Memory: Page Replacement CSSE 332 Operating Systems Rose-Hulman Institute of Technology Announcements Project E & presentation are due Wednesday Team reflections due Monday, May 19 The need for

### 1. Background. 2. Demand Paging

COSC4740-01 Operating Systems Design, Fall 2001, Byunggu Yu Chapter 10 Virtual Memory 1. Background PROBLEM: The entire process must be loaded into the memory to execute limits the size of a process (it

### CS370 Operating Systems

CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 32 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions for you What is

### Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

### Memory management, part 2: outline

Memory management, part 2: outline Page replacement algorithms Modeling PR algorithms o Working-set model and algorithms Virtual memory implementation issues 1 Page Replacement Algorithms Page fault forces

### CS 333 Introduction to Operating Systems. Class 14 Page Replacement. Jonathan Walpole Computer Science Portland State University

CS 333 Introduction to Operating Systems Class 14 Page Replacement Jonathan Walpole Computer Science Portland State University Page replacement Assume a normal page table (e.g., BLITZ) User-program is

### stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

Question # 1 of 10 ( Start time: 07:24:13 AM ) Total Marks: 1 LRU page replacement algorithm can be implemented by counter stack linked list all of the given options Question # 2 of 10 ( Start time: 07:25:28

### Topics: Virtual Memory (SGG, Chapter 09) CS 3733 Operating Systems

Topics: Virtual Memory (SGG, Chapter 09) 9.1-9.7 CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB 3.330 Phone: (210)

### Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Contents Hardware and control structures Operating system software Unix and Solaris memory management Linux memory management Windows 2000 memory management Characteristics of

### CS 3733 Operating Systems:

CS 3733 Operating Systems: Topics: Virtual Memory (SGG, Chapter 09) Instructor: Dr. Dakai Zhu Department of Computer Science @ UTSA 1 Reminders Assignment 3: due March 30, 2018 (mid-night)! Part I: fixed

### Operating Systems Lecture 6: Memory Management II

CSCI-GA.2250-001 Operating Systems Lecture 6: Memory Management II Hubertus Franke frankeh@cims.nyu.edu What is the problem? Not enough memory Have enough memory is not possible with current technology

### Memory Management. To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time.

Memory Management To improve CPU utilization in a multiprogramming environment we need multiple programs in main memory at the same time. Basic CPUs and Physical Memory CPU cache Physical memory

### Lecture 14 Page Replacement Policies

CS 423 Operating Systems Design Lecture 14 Page Replacement Policies Klara Nahrstedt Fall 2011 Based on slides by YY Zhou and Andrew S. Tanenbaum Overview Administrative Issues Page Replacement Policies

### Basic Memory Management

Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it

### Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Allocation of Page Frames Scenario Several physical pages allocated to processes A, B, and C. Process B page faults. Which page should

### Chapter 8 Virtual Memory

Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Modified by Rana Forsati for CSE 410 Outline Principle of locality Paging - Effect of page

### Role of OS in virtual memory management

Role of OS in virtual memory management Role of OS memory management Design of memory-management portion of OS depends on 3 fundamental areas of choice Whether to use virtual memory or not Whether to use

### Week 2: Tiina Niklander

Virtual memory Operations and policies Chapters 3.4. 3.6 Week 2: 17.9.2009 Tiina Niklander 1 Policies and methods Fetch policy (Noutopolitiikka) When to load page to memory? Placement policy (Sijoituspolitiikka

### Memory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging

Memory Management Outline Operating Systems Processes (done) Memory Management Basic (done) Paging (done) Virtual memory Virtual Memory (Chapter.) Motivation Logical address space larger than physical

### Chapter 4 Memory Management

Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms 4.6 Design issues for paging systems 4.7

### Operating Systems Virtual Memory. Lecture 11 Michael O Boyle

Operating Systems Virtual Memory Lecture 11 Michael O Boyle 1 Paged virtual memory Allows a larger logical address space than physical memory All pages of address space do not need to be in memory the

### Memory Management. Virtual Memory. By : Kaushik Vaghani. Prepared By : Kaushik Vaghani

Memory Management Virtual Memory By : Kaushik Vaghani Virtual Memory Background Page Fault Dirty Page / Dirty Bit Demand Paging Copy-on-Write Page Replacement Objectives To describe the benefits of a virtual

### !! What is virtual memory and when is it useful? !! What is demand paging? !! When should pages in memory be replaced?

Chapter 10: Virtual Memory Questions? CSCI [4 6] 730 Operating Systems Virtual Memory!! What is virtual memory and when is it useful?!! What is demand paging?!! When should pages in memory be replaced?!!

### e-pg Pathshala Subject: Computer Science Paper: Operating Systems Module 29: Allocation of Frames, Thrashing Module No: CS/OS/29 Quadrant 1 e-text

29.1 Introduction e-pg Pathshala Subject: Computer Science Paper: Operating Systems Module 29: Allocation of Frames, Thrashing Module No: CS/OS/29 Quadrant 1 e-text In an earlier module, we learnt what

### Virtual Memory - I. Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - XV. University at Buffalo.

CSE /5 - Operating Systems Fall 0 Lecture - XV Virtual Memory - I Tevfik Koşar University at Buffalo October rd, 0 Roadmap Virtual Memory Demand Paging Page Faults Page Replacement Page Replacement Algorithms

### Virtual Memory - I. Roadmap. Background. Demand Paging. valid-invalid bit. Tevfik Koşar. CSE 421/521 - Operating Systems Fall 2012

CSE / - Operating Systems Fall Roadmap Lecture - XV Virtual Memory - I Virtual Memory Demand Paging Page Faults Page Replacement Page Replacement Algorithms FIFO Tevfik Koşar University at Buffalo October

### Chapter 8: Main Memory Chapter 9: Virtual Memory. Operating System Concepts 9th Edition

Chapter 8: Main Memory Chapter 9: Virtual Memory Dr Prabhaker Mateti, CEG 4350 edition This collection is the combined edition of slides for Chapters 8 and 9 of SG, with several slides deleted or modified.

### MEMORY MANAGEMENT/1 CS 409, FALL 2013

MEMORY MANAGEMENT Requirements: Relocation (to different memory areas) Protection (run time, usually implemented together with relocation) Sharing (and also protection) Logical organization Physical organization

### Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is.

Chapter 4 Memory Management Ideally programmers want memory that is Memory Management large fast non volatile 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms

### ECE7995 Caching and Prefetching Techniques in Computer Systems. Lecture 8: Buffer Cache in Main Memory (I)

ECE7995 Caching and Prefetching Techniques in Computer Systems Lecture 8: Buffer Cache in Main Memory (I) 1 Review: The Memory Hierarchy Take advantage of the principle of locality to present the user

### CS450/550 Operating Systems

CS450/550 Operating Systems Lecture 4 memory Palden Lama Department of Computer Science CS450/550 Memory.1 Review: Summary of Chapter 3 Deadlocks and its modeling Deadlock detection Deadlock recovery Deadlock

### Course: Operating Systems Instructor: M Umair. M Umair

Course: Operating Systems Instructor: M Umair Memory Management Introduction { Ref: Operating System Concepts 8th Edition Abraham Silberschatz, Greg Gagne, Peter B. Galvin } Address Binding Addresses in

### VIRTUAL MEMORY READING: CHAPTER 9

VIRTUAL MEMORY READING: CHAPTER 9 9 MEMORY HIERARCHY Core! Processor! Core! Caching! Main! Memory! (DRAM)!! Caching!! Secondary Storage (SSD)!!!! Secondary Storage (Disk)! L cache exclusive to a single

### Virtual Memory. Chapter 8

Virtual Memory 1 Chapter 8 Characteristics of Paging and Segmentation Memory references are dynamically translated into physical addresses at run time E.g., process may be swapped in and out of main memory

### Preview. Review. Modeling Page Replacement Algorithm. Modeling Page Replacement Algorithm. Modeling Page Replacement Algorithm (Stack Algorithm)

/7/8 Review review Virtual Memory aging age tables Multiple level page tables age Replacement Algorithms Optimal Algorithm First In First Out (FIFO) Not Recently Used Algorithm (NRU) econd Chance Algorithm

### Virtual Memory. Today.! Virtual memory! Page replacement algorithms! Modeling page replacement algorithms

Virtual Memory Today! Virtual memory! Page replacement algorithms! Modeling page replacement algorithms Reminder: virtual memory with paging! Hide the complexity let the OS do the job! Virtual address

### Chapter 8 Main Memory

Chapter 8 Main Memory 8.1, 8.2, 8.3, 8.4, 8.5 Chapter 9 Virtual memory 9.1, 9.2, 9.3 https://www.akkadia.org/drepper/cpumemory.pdf Images from Silberschatz Pacific University 1 How does the OS manage memory?

### Chapter 8 Virtual Memory

Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Operating Systems: Internals and Design Principles You re gonna need a bigger boat. Steven

### ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program

IT 540 Operating Systems ECE519 Advanced Operating Systems Prof. Dr. Hasan Hüseyin BALIK (8 th Week) (Advanced) Operating Systems 8. Virtual Memory 8. Outline Hardware and Control Structures Operating

### Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

1 Memory Management Address Binding The normal procedures is to select one of the processes in the input queue and to load that process into memory. As the process executed, it accesses instructions and

### Modeling Page Replacement: Stack Algorithms. Design Issues for Paging Systems

Modeling Page Replacement: Stack Algorithms 7 4 6 5 State of memory array, M, after each item in reference string is processed CS450/550 Memory.45 Design Issues for Paging Systems Local page replacement

### CS510 Operating System Foundations. Jonathan Walpole

CS510 Operating System Foundations Jonathan Walpole Page Replacement Page Replacement Assume a normal page table (e.g., BLITZ) User-program is executing A PageInvalidFault occurs! - The page needed is

### 10: Virtual Memory Management

CSC400 - Operating Systems 10: Virtual Memory Management J. Sumey Introduction virtual memory management: concerned with the actual management operations of a virtual memory system fetch strategies: when

### TLB Recap. Fast associative cache of page table entries

Virtual Memory II 1 TLB Recap Fast associative cache of page table entries Contains a subset of the page table What happens if required entry for translation is not present (a TLB miss)? 2 TLB Recap TLB

### CS370: Operating Systems [Spring 2017] Dept. Of Computer Science, Colorado State University

Frequently asked questions from the previous class survey CS : OPERATNG SYSTEMS [VRTUAL MEMORY] Shrideep Pallickara Computer Science Colorado State University Multi-level paging: How many levels deep?

### Wednesday, November 22, 2017

Wednesday, November 22, 2017 Topics for today Storage management (Chapter 9) Main memory (3) Variable-partition multiprogramming (4) Paging (5) Virtual memory Page turning algorithms Summary of 5 memory

### Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Multiprogramming Memory Management so far 1. Dynamic Loading The main Program gets loaded into memory Routines are stored in Relocatable Load format on disk As main program (or

### Memory Management. Jo, Heeseung

Memory Management Jo, Heeseung Today's Topics Why is memory management difficult? Old memory management techniques: Fixed partitions Variable partitions Swapping Introduction to virtual memory 2 Memory

### Computer Systems II. Memory Management" Subdividing memory to accommodate many processes. A program is loaded in main memory to be executed

Computer Systems II Memory Management" Memory Management" Subdividing memory to accommodate many processes A program is loaded in main memory to be executed Memory needs to be allocated efficiently to

### Operating Systems CSE 410, Spring Virtual Memory. Stephen Wagner Michigan State University

Operating Systems CSE 410, Spring 2004 Virtual Memory Stephen Wagner Michigan State University Virtual Memory Provide User an address space that is larger than main memory Secondary storage is used to

### CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems Fall 2016 Lecture 11: Page Replacement Geoffrey M. Voelker Administrivia Lab time This week: Thu 4pm, Sat 2pm Next week: Tue, Wed At Washington University in St.

### Wednesday, November 4, 2009

Wednesday, November 4, 2009 Topics for today Storage management Main memory (1) Uniprogramming (2) Fixed-partition multiprogramming (3) Variable-partition multiprogramming (4) Paging (5) Virtual memory

### Last class: Today: Paging. Virtual Memory

Last class: Paging Today: Virtual Memory Virtual Memory What if programs require more memory than available physical memory? Use overlays ifficult to program though! Virtual Memory. Supports programs that

### Operating System - Virtual Memory

Operating System - Virtual Memory Virtual memory is a technique that allows the execution of processes which are not completely available in memory. The main visible advantage of this scheme is that programs

### Memory Management Virtual Memory

Memory Management Virtual Memory Part of A3 course (by Theo Schouten) Biniam Gebremichael http://www.cs.ru.nl/~biniam/ Office: A6004 April 4 2005 Content Virtual memory Definition Advantage and challenges

### Operating Systems. User OS. Kernel & Device Drivers. Interface Programs. Memory Management

Operating Systems User OS Kernel & Device Drivers Interface Programs Management Brian Mitchell (bmitchel@mcs.drexel.edu) - Operating Systems 1 Management is an important resource that needs to be managed

### Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Silberschatz, Galvin and Gagne 2005 Background Program/Code

### Virtual Memory Design and Implementation

Virtual Memory Design and Implementation Today! Page replacement algorithms! Some design and implementation issues Next! Last on virtualization VMMs How can any of this work?!?!! Locality Temporal locality

### Locality of Reference

Locality of Reference 1 In view of the previous discussion of secondary storage, it makes sense to design programs so that data is read from and written to disk in relatively large chunks but there is

### Chapter 4: Memory Management. Part 1: Mechanisms for Managing Memory

Chapter 4: Memory Management Part 1: Mechanisms for Managing Memory Memory management Basic memory management Swapping Virtual memory Page replacement algorithms Modeling page replacement algorithms Design

### Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Memory Management Ch. 3 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Memory Hierarchy Cache CPU Main Swap Area Memory

### Study of Page Replacement Algorithms and their analysis with C#

The International Journal Of Engineering And Science (IJES) Volume 5 Issue 1 Pages PP -53-57 2016 ISSN (e): 2319 1813 ISSN (p): 2319 1805 Study of Page Replacement Algorithms and their analysis with C#

### Memory Management. CSCI 315 Operating Systems Design Department of Computer Science

Memory Management CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture are based on those from Operating Systems Concepts, 9th ed., by Silberschatz, Galvin,

### Memory Management (Chaper 4, Tanenbaum)

Memory Management (Chaper 4, Tanenbaum) Memory Mgmt Introduction The CPU fetches instructions and data of a program from memory; therefore, both the program and its data must reside in the main (RAM and

### Lecture 12: Demand Paging

Lecture 1: Demand Paging CSE 10: Principles of Operating Systems Alex C. Snoeren HW 3 Due 11/9 Complete Address Translation We started this topic with the high-level problem of translating virtual addresses

### CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 15: Caching: Demand Paged Virtual Memory

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring 2003 Lecture 15: Caching: Demand Paged Virtual Memory 15.0 Main Points: Concept of paging to disk Replacement policies

### Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

CSC 4103 - Operating Systems Spring 2007 Lecture - XII Main Memory - II Tevfik Koşar Louisiana State University March 8 th, 2007 1 Roadmap Dynamic Loading & Linking Contiguous Memory Allocation Fragmentation

### CS 4410 Operating Systems. Page Replacement (2) Summer 2016 Cornell University

CS 4410 Operating Systems Page Replacement (2) Summer 2016 Cornell University Today Algorithm that approximates the OPT replacement algorithm. 2 Least Recently Used (LRU) Page Replacement A recently used