Memory Management & Virtual Memory © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.

Slides:



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

Chapter 10: Virtual Memory
Basic Memory Management Monoprogramming Protection Swapping Overlaying OS space User space.
§12.4 Static Paging Algorithms
Chapter 4 Memory Management Page Replacement 补充:什么叫页面抖动?
Virtual Memory Management G. Anuradha Ref:- Galvin.
Virtual Memory. 2 What is virtual memory? Each process has illusion of large address space –2 32 for 32-bit addressing However, physical memory is much.
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement.
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
Memory/Storage Architecture Lab Computer Architecture Virtual Memory.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
CS 104 Introduction to Computer Science and Graphics Problems
Virtual Memory. Names, Virtual Addresses & Physical Addresses Source Program Absolute Module Name Space P i ’s Virtual Address Space P i ’s Virtual Address.
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.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 9: Virtual Memory.
Virtual Memory Management B.Ramamurthy. Paging (2) The relation between virtual addresses and physical memory addres- ses given by page table.
1 Virtual Memory Management B.Ramamurthy Chapter 10.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
Slide 12-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter Virtual Memory.
Maninder Kaur VIRTUAL MEMORY 24-Nov
Virtual Memory.
Chapter 3 Memory Management: Virtual Memory
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz and Galvin  Chapters 3 and 5 Possible questions –Tracing a given program involving fork, exec, semaphores, and share memory –Wring.
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Memory Management Techniques
Subject: Operating System.
CS 241 Section Week #9 (11/05/09). Topics MP6 Overview Memory Management Virtual Memory Page Tables.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
CSC 360, Instructor: Kui Wu Memory Management II: Virtual Memory.
Homework Assignment #3 J. H. Wang Nov. 13, 2015.
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.
Chapter 9: Virtual-Memory Management. 9.2 Silberschatz, Galvin and Gagne ©2005 Operating System Principles Chapter 9: Virtual-Memory Management 9.1 Background.
VIRTUAL MEMORY Virtual Address Space. In computing, virtual address space (abbreviated VAS) is a memory mapping mechanism available in modern operating.
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.
Virtual Memory. 2 Last Week Memory Management Increase degree of multiprogramming –Entire process needs to fit into memory Dynamic Linking and Loading.
Chapters 3 and 5 Possible questions
Logistics Homework 5 will be out this evening, due 3:09pm 4/14
Memory Management (2).
Chapter 9: Virtual Memory – Part I
Computer Architecture
Operating Systems: A Modern Perspective, Chapter 12
Operating Systems: A Modern Perspective, Chapter 12
Virtual Memory © 2004, D. J. Foreman.
Module 9: Virtual Memory
Synchronization Memory Management
Chapter 9: Virtual-Memory Management
Page Replacement.
CS241 Section: Week 10.
Memory Management & Virtual Memory
Lecture 39 Syed Mansoor Sarwar
Lecture 40 Syed Mansoor Sarwar
5: Virtual Memory Background Demand Paging
Synchronization Memory Management
Computer Architecture
Exercise (11).
Exercise (10).
Scheduling & File Management
CSE 542: Operating Systems
Module 9: Virtual Memory
COMP755 Advanced Operating Systems
Chapter 9: Virtual Memory CSS503 Systems Programming
Student : Yan Wang student ID:
Virtual Memory.
CSE 542: Operating Systems
Scheduling & File Management
Presentation transcript:

Memory Management & Virtual Memory © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2 Managing Free Memory Blocks Best fit & Worst fit strategies Best fit & Worst fit strategies Comparisons between the two, which one is possibly better? Comparisons between the two, which one is possibly better?

3 Dynamic Address Space Binding Also referred to as dynamic address relocation Also referred to as dynamic address relocation CPUs need to include relocation registers CPUs need to include relocation registers If the process is divided/broken into segments, then multiple registers are needed (i.e. code/text register, stack register, data register) If the process is divided/broken into segments, then multiple registers are needed (i.e. code/text register, stack register, data register)

4 Bound Checking How the memory manager can provide a service to the security manager How the memory manager can provide a service to the security manager Include a limit register in the CPU and validate all memory access requests against that limit Include a limit register in the CPU and validate all memory access requests against that limit

5 Virtual Memory What is it? What is it? Implementing virtual memory using segmentation Implementing virtual memory using segmentation Advantages of segmentation Advantages of segmentation Potential problems and disadvantages of segmentation Potential problems and disadvantages of segmentation

6 Virtual Memory through Demand Paging What is paging? What is paging? Advantages of paging Advantages of paging Difference between pages and frames Difference between pages and frames

7 Paging – Mapping between Virtual and Physical Addresses Utilization of page tables Utilization of page tables Virtual address translation of paging Virtual address translation of paging Page faults and their overhead Page faults and their overhead Different strategies to reduce page faults Different strategies to reduce page faults What is a paging reference stream? What is a paging reference stream?

8 Static Paging Algorithms for Page Replacement Random Replacement Random Replacement Belady Optimal Replacement Belady Optimal Replacement Least Recently Used (LRU) / Most Recently Used (MRU) Least Recently Used (LRU) / Most Recently Used (MRU) Least Frequently Used (LFU) / Most Frequently Used (MFU) Least Frequently Used (LFU) / Most Frequently Used (MFU)

9 Static Paging Algorithms for Page Replacement Stack Algorithms Stack Algorithms Why First In First Out (FIFO) is not a good replacement algorithm Why First In First Out (FIFO) is not a good replacement algorithm Belady’s anomaly problem Belady’s anomaly problem

10 Attempts to Reduce Page Faults Increase number of frames allocated to the process Increase number of frames allocated to the process Will this always achieve better performance (less page faults)? Why? Will this always achieve better performance (less page faults)? Why? Are there any disadvantages of such approach? Are there any disadvantages of such approach?

11 Dynamic Paging Algorithms The Working Set algorithm The Working Set algorithm Advantages/Disadvantages Advantages/Disadvantages Are there any disadvantages of such approach? Are there any disadvantages of such approach?

12 Severity of Page Faults Examples were given in class to show how sever page faults can be in terms of degrading system performance Examples were given in class to show how sever page faults can be in terms of degrading system performance What is trashing What is trashing What can be done to reduce page faults? What can be done to reduce page faults? Reserving some memory space to reduce the number of page faults Reserving some memory space to reduce the number of page faults Advantages and disadvantages of this solution Advantages and disadvantages of this solution

13 Where is this week coverage in the textbook? Chapter 8: Chapter 8: Sections 8.5 & 8.6 Sections 8.5 & 8.6  Permanently Skip: 8.7 & 8.8 Chapter 9: Chapter 9: Sections 9.1, 9.2, 9.3 & 9.4 Sections 9.1, 9.2, 9.3 & 9.4 Important Notes: Some examples were given in class to show how severe page faults can be on performance. Different solutions & proposals to reduce the number of page faults were also discussed. You must refer to your class notes for these examples and the proposed solutions.  Also notice that MRU & MFU were discusses in class.