Student : Yan Wang student ID:

Slides:



Advertisements
Similar presentations
Paging: Design Issues. Readings r Silbershatz et al: ,
Advertisements

MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 3 Memory Management Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
1 Virtual Memory Management B.Ramamurthy. 2 Demand Paging Main memory LAS 0 LAS 1 LAS 2 (Physical Address Space -PAS) LAS - Logical Address.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
Memory/Storage Architecture Lab Computer Architecture Virtual Memory.
Memory Management Norman White Stern School of Business.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
Virtual Memory. Names, Virtual Addresses & Physical Addresses Source Program Absolute Module Name Space P i ’s Virtual Address Space P i ’s Virtual Address.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
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.
Computer Organization and Architecture
Virtual Memory BY JEMINI ISLAM. What is Virtual Memory Virtual memory is a memory management system that gives a computer the appearance of having more.
Maninder Kaur VIRTUAL MEMORY 24-Nov
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Chapter 3 Memory Management: Virtual Memory
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Operating Systems Chapter 8
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Lecture 19: Virtual Memory
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
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Memory Management & Virtual Memory © Dr. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
A PRESENTATION ON VIRTUAL MEMORY (PAGING) Submitted to Submitted by Prof. Dr. Ashwani kumar Ritesh verma Dept. Of Physics Mtech (Instrumentation) Roll.
Memory Management Chapter 3
CS161 – Design and Architecture of Computer
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
MODERN OPERATING SYSTEMS Third Edition ANDREW S
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Computer Organization
Memory Management Virtual Memory.
Virtual memory.
Memory Management.
Memory Management (2).
Chapter 2 Memory and process management
ECE232: Hardware Organization and Design
CS161 – Design and Architecture of Computer
Chapter 9: Virtual Memory – Part I
Ramya Kandasamy CS 147 Section 3
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Operating Systems Virtual Memory Alok Kumar Jagadev.
Virtual Memory Chapter 8.
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
EECE.4810/EECE.5730 Operating Systems
Chapter 9: Virtual-Memory Management
Page Replacement.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Chapter 9: Virtual Memory
Operating Systems.
Chap. 12 Memory Organization
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Contents Memory types & memory hierarchy Virtual memory (VM)
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 4/5/2019.
Chapter 1 Computer System Overview
Computer Architecture
Lecture 9: Caching and Demand-Paged Virtual Memory
CSE 542: Operating Systems
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
Operating Systems Concepts
COMP755 Advanced Operating Systems
Virtual Memory.
CSE 542: Operating Systems
Virtual Memory 1 1.
Presentation transcript:

Student : Yan Wang student ID: 104698 Virtual Memory Student : Yan Wang student ID: 104698

Why Do We Need Virtual Memory? * 07/16/96 Why Do We Need Virtual Memory? Storage allocation has always been an important consideration in computer programming - Cost - Space - Avoid overlay system - More and more complex programs make it difficult for programmer to handle the machine Storage allocation has always been an important consideration in computer programming cost (due to the high cost of main memory and relative abundance and lower cost secondary storage) Space (program code and data required for execution of a process must reside in main memory to exeuied, but main memory may not large enough to accomdate the needs of an entire process) Avoid overlay system (early computer programmers divided programs into sections that were transferred into main memory for a period of processing time. As the program proceeded, new section moved into main memory and replaced sections that were not needed at that time. In this early era of computing, the programmer was responsible for devising this overlay system) More and more complex programs, the programmer became difficult to to hander the machine. (As higher level languages became popular for writing more complex programs and the programmer became less with the machine, the efficiency of complex programs suffered from poor overlay systems.The problem of strage allocation became more complex) 2 *

Overview to Solve Storage Allocation Static allocation memory resource and the memory reference can be predicted Dynamic allocation Opposite to static allocation. Relies on memory usage ,actual program needs, not on predicting memory needs Shortcomings of static and dynamic allocations 3

4 What is Virtual Memory? Logical memory Uses secondary storage to increase the processor’s main memory Unified view for processes Technique that allows large processes to run Components: mapper, associative memory, page table and replacement policies 4

5 What does mapper do? Mapper * 07/16/96 What does mapper do? Mapper Part of operating system that translates the logical page number into the physical page frame number where the main memory holds page The page table reveals that page is not resident in the main memory, the mapper issues a page fault to the operating system Execution is suspended on the process until the desired page can be read in from the secondary store and placed in main memory The mapper function must be very fast 5 *

6 Associative Memory Also called translation lookside buffers (TLBs) * 07/16/96 Associative Memory Also called translation lookside buffers (TLBs) More efficiency to access the page Table. A special high-speed memory registers. Only the most frequently accessed pages are represented by associative memory A key and a value 6 *

How Associative Memory Works ? * 07/16/96 How Associative Memory Works ? The key to associative memory registers checks the logic address when it enters If they match,the value corresponding to the key is output. Then it returns the value that contains two things: 1. The physical address of the logical page 2. The access code to indicate its presence in main memory, Example 7 *

8 Page Table Implementation of swapping in virtual memory * 07/16/96 Page Table Implementation of swapping in virtual memory Each address space within the system is associated with a page table and a disk map Two tables describe an “entire address space” Page table Disk map 8 *

Page Table (continue) If the P flag is set, the page is currently in the main memory. Its location in memory is determined by the F value. F is the physical address number If the P flag is off, the address mapper will generate a page fault If a process attempts reference to the page, the page fault handler will use the disk map to the location of page on the disk and swap it into the main memory 9

Virtual Memory Components Live demo A Java applet to show the components of Virtual Memory on the web from George Mason University. 10

Multi Level Page Table For large processes, the page table needs a lot of room in the memory so that it won’t squeeze the process out of the memory. One solution is to organize page tables into a multilevel hierarchy A part of page table in the main memory 11

12 Replacement Policies First In First Out ( FIFO) Least Recently Use ( LRU) Last In First Out ( LIFO) Least Frequently Used ( LFU). Optimal (OPT or MIN) 12

LRU Replacement Policy The policy is to replace the one that has not been referenced for the longer time The policy assumes that the recently used one will be the one immediately used in the future. The operating system keeps track of when each page was referenced by recording the time of reference or by maintaining a stack of reference Example algorithm of Least Recently Used 13

LRU Replacement Algorithm(cont.) 14

15 Conclusion Virtual memory is a very useful tool. Main problems of virtual memory 1. Manage allocation 2. Manage relocation 3. Manage replacement policies in the memory. 15