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.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
CSIE30300 Computer Architecture Unit 10: Virtual Memory Hsin-Chou Chi [Adapted from material by and
Virtual Memory Hardware Support
CSC 4250 Computer Architectures December 8, 2006 Chapter 5. Memory Hierarchy.
CMPT 300: Final Review Chapters 8 – Memory Management: Ch. 8, 9 Address spaces Logical (virtual): generated by the CPU Physical: seen by the memory.
Recap. The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
Memory Management.
Memory Management 2010.
Virtual Memory Chapter 8.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Lecture 9: Virtual Memory Operating System I Spring 2007.
1 Chapter 8 Virtual Memory Virtual memory is a storage allocation scheme in which secondary memory can be addressed as though it were part of main memory.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Virtual Memory I Chapter 8.
03/22/2004CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Memory Management From Chapter 4, Modern Operating Systems, Andrew S. Tanenbaum.
Operating Systems Chapter 8
CSE431 L22 TLBs.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 22. Virtual Memory Hardware Support Mary Jane Irwin (
Lecture 19: Virtual Memory
8.4 paging Paging is a memory-management scheme that permits the physical address space of a process to be non-contiguous. The basic method for implementation.
Cosc 2150: Computer Organization Chapter 6, Part 2 Virtual Memory.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
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.
IT253: Computer Organization
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Subject: Operating System.
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.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
Virtual Memory Chapter 8. Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
1 Virtual Memory Chapter 8. 2 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time –A process.
CE Operating Systems Lecture 14 Memory management.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
1 Memory Management (b). 2 Paging  Logical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter.
Virtual Memory. Background Virtual memory is a technique that allows execution of processes that may not be completely in the physical memory. Virtual.
Introduction to Virtual Memory and 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. Why memory management? n Processes need to be loaded in memory to execute n Multiprogramming n The task of subdividing the user area.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
CS.305 Computer Architecture Memory: Virtual Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from slides kindly made available.
Informationsteknologi Wednesday, October 3, 2007Computer Systems/Operating Systems - Class 121 Today’s class Memory management Virtual memory.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
8.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Fragmentation External Fragmentation – total memory space exists to satisfy.
Memory Management Chapter 5 Advanced Operating System.
Project 4 Awards First Place Group 7 Samuel Bartlett Michael Phillips Norman Chen.
Virtual Memory Chapter 8.
Virtual memory.
Chapter 2 Memory and process management
Memory COMPUTER ARCHITECTURE
Virtual Memory Chapter 8.
Lecture 10: Virtual Memory
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy 11/12/2018.
Operating System Concepts
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Computer Architecture
Virtual Memory فصل هشتم.
Lecture 3: Main Memory.
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CSE451 Virtual Memory Paging Autumn 2002
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Operating Systems: Internals and Design Principles, 6/E
Presentation transcript:

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 main memory than it really has.

Reasons for using virtual memory To free programmers from the need to carry out storage allocation and to permit efficient sharing of memory space among different users. To free programmers from the need to carry out storage allocation and to permit efficient sharing of memory space among different users. To make programs independent of the configuration and the capacity of the memory systems used during their execution. To make programs independent of the configuration and the capacity of the memory systems used during their execution. To achieve the high access rates and low cost per bit that is possible with a memory hierarchy. To achieve the high access rates and low cost per bit that is possible with a memory hierarchy.

2 Main Advantages of Virtual Memory 1. Main memory is used more efficiently 2.Programs that are bigger than main memory can still be executed.

Implementation of Virtual Memory System: Paging: - Fixed-size blocks Segmentation:- Variable size blocks Paged Segmentation: Combination of two systems.

Paging pages page frames. Paging systems use fixed-length blocks called pages and assign them to fixed regions of physical memory called page frames.

Page Table: Frame Number Page Number Page Table

Pages: Example: Each page has the same length, typically a power of 2. CodeData

Advantage of Paging: fully associative. The main advantage of paging is that memory allocation is greatly simplified, since an incoming pages can be assigned to any available page frame which is also known as fully associative.

Memory Mapping and Page Table: Memory Mapping: With virtual memory, the CPU produces virtual addresses that are translated by combination of hardware and software to physical addresses, which access main memory. This is called memory mapping or address translation. Page Table: Translation between virtual addresses and physical addresses is done via a page table.

Virtual page number Page offset Page table Main memory The Mapping of a Virtual Address to a Physical Address Via a Page Table Virtual address Physical Address

Techniques for Fast Address Translation: To reduce address translation time, computers use a cache dedicated to these address translation, which is called a translation look-aside buffer or TLB.

Structure of a Virtual Memory System : TLB Memory Map Virtual Block Address Logical (virtual) Address Physical Address Displacement Physical block Address Main Memory Secondary Memory

Representative Organization of a Page Table : Page Page Presence Change Access Address Frame bit P bit C rights A R, X C D6C7T9 0 R, W, X E R, W, X F R

Selecting Page Size: Choosing a page size is a question of balancing forces that favor a larger page size versus those favoring a smaller size. They both have some advantages and disadvantages :

Advantage of Choosing Large Page Size:  The size of the page table is inversely proportional to the page size: Memory can therefore be saved by making the pages bigger  Transferring larger pages to or from secondary storage, possibly over a network, is more efficient than transferring smaller pages.

Advantage Of Choosing Small Page Size : The main reason for choosing smaller page is conserving storage. A small page size will result in less wasted storage when a contiguous region of virtual memory is not equal in size to a multiple of the page size. The term for this unused memory in a page is internal fragmentation.

Page Replacement Policies: 3 major page replacement policies:  FIFO  LRU  OPT

FIFO FIFO(first in first out) : With FIFO, the oldest page in memory is selected for replacement Example: *2*22555 *5* *2*

LRU: (least recently used) LRU Policy- a policy that selects the page that has gone unused for the longest period of time *2*215 *2*24 *5*532 *5*5 *2*

OPT(optimal replacement policy) In this policy we will replace the memory with the page address which we will not use in the near future.

Examples of OPT : *2*222 *2* *2* *3* *5*555 *5*55

Segmentation : Segment : A segment is a set of logically related contiguous words generated by a compiler or a programmer. Segmentation : A memory management technique that allocates main memory by segments is called segmentation.

Size of Segments :  Variable size blocks are called segments.  Segments size varies.  The largest segment supported on any machine ranges from 2^16 bytes up to 2^32 bytes Code Data

Segment Table: The physical addresses assigned to the segments are maintained in a memory map called a segment table.

Segment-Table Entry Segment-Table Tag Presence Bit P Segment size Z Physical address S

External Fragmentation: External Fragmentation: It happens because of unused pieces of main memory.

Paged Segments : Combination of paging and segmentation. This is done by dividing each segment into pages. A word then has a logical address with 3 components-  Segment Address  Page Address  Line Address

Advantage of Paged Segments: It eliminates the need to store the segment in a contiguous region of main memory.

References Dos Reis, Anthony J. Assembly Language And Computer Architecture Using C++ And Java. Hennessy, John and Patterson, David. Computer Organization and Design. San Mateo,California : Morgan Kaufmann, Hennessy, John and Patterson, David. Computer Architecture A Quantitative Approach. Sanfrancisco : Morgan Kaufmann, Hennessy, John and Patterson, David. Computer Architecture A Quantitative Approach : Morgan Kaufmann, Hayes, John. Computer Architecture And Organization. McGraw-Hill Book Company, 1988.