VIRTUAL MEMORY. Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it.

Slides:



Advertisements
Similar presentations
MEMORY popo.
Advertisements

Memory.
1 Memory hierarchy and paging Electronic Computers M.
OS Fall’02 Virtual Memory Operating Systems Fall 2002.
Allocating Memory.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
OS Spring ‘04 Paging and Virtual Memory Operating Systems Spring 2004.
Memory Management (II)
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management -3 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
Paging and Virtual Memory. Memory management: Review  Fixed partitioning, dynamic partitioning  Problems Internal/external fragmentation A process can.
Chapter 3.2 : Virtual Memory
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.
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
Computer Organization and Architecture
Virtual Memory I Chapter 8.
CSCI2413 Lecture 6 Operating Systems Memory Management 2 phones off (please)
03/17/2008CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying the textbook.
Virtual Memory  Early computers had a small and fixed amount to memory. All programs had to be able to fit in this memory. Overlays were used when the.
Operating System Machine Level  An operating system is a program that, from the programmer’s point of view, adds a variety of new instructions and features,
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally MEMORYMANAGEMNT.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
Fundamental Concepts.  Maximum size of the Main Memory  byte-addressable  CPU-Main Memory Connection Up to 2 k addressable MDR MAR k-bit address bus.
Chapter 4 Storage Management (Memory Management).
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation.
Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support.
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.
CE Operating Systems Lecture 14 Memory management.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Virtual Memory 1 1.
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
Introduction: Memory Management 2 Ideally programmers want memory that is large fast non volatile Memory hierarchy small amount of fast, expensive memory.
Multilevel Caches Microprocessors are getting faster and including a small high speed cache on the same chip.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Operating Systems Session 7: – Virtual Memory organization Operating Systems.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Virtual Memory. Cache memory enhances performance by providing faster memory access speed. Virtual memory enhances performance by providing greater memory.
Basic Paging (1) logical address space of a process can be made noncontiguous; process is allocated physical memory whenever the latter is available. Divide.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Computer Organization
Memory Management.
ITEC 202 Operating Systems
Chapter 2 Memory and process management
The Memory System (Chapter 5)
Memory COMPUTER ARCHITECTURE
Paging COMP 755.
Day 20 Virtual Memory.
Virtual Memory Chapter 8.
Operating System Concepts
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 8 11/24/2018.
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
Computer Architecture
Module IV Memory Organization.
Memory Management Lectures notes from the text supplement by Siberschatz and Galvin Modified by B.Ramamurthy Chapter 9 12/1/2018.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 29: Virtual Memory-Address Translation
Contents Memory types & memory hierarchy Virtual memory (VM)
Chapter 8: Memory Management strategies
Operating Systems: Internals and Design Principles, 6/E
Virtual Memory 1 1.
Page Main Memory.
Presentation transcript:

VIRTUAL MEMORY

Virtual memory technique is used to extents the size of physical memory When a program does not completely fit into the main memory, it is divided into segments. The segments which are currently being executed are kept in the main memory and remaining segments are stored in the secondary memory If an executing program needs a segment which is not currently in the main memory, the required segment is copied from secondary memory

VIRTUAL MEMORY When a new segment of a program is to be copied into main memory it must replace another segment Then the OS moves the program automatically between main memory and secondary memory and this technique is called Virtual memory The addresses that issued by the processor are called virtual or logical address

VIRTUAL MEMORY This address are translated into physical addresses by memory management unit (MMU) If the referenced address is not in the main memory, its contents must be brought into a suitable location in the main memory before they can be used

VIRTUAL MEMORY

Address Translation A simple method for translating virtual addresses into physical addresses is to assume that all programs and data are composed of fixed-length units called pages, each of which consists of a block of words that occupy contiguous locations in the main memory

VIRTUAL MEMORY Pages commonly range from 2K to 16K bytes in length. Pages should not be too small, because the access time of a magnetic disk is much longer (10 to 20 milliseconds) than the access time of the main memory.

VIRTUAL MEMORY considerable amount of time to locate the data on the disk, but once located, the data can be transferred at a rate of several megabytes per second. On the other hand, if pages are too large it is possible that a substantial portion of a page may not be used, yet this unnecessary data will occupy valuable space in the main memory.

VIRTUAL MEMORY The virtual-memory mechanism bridges the size and speed gaps between the main memory and secondary storage and is usually implemented in part by software techniques. Conceptually, cache techniques and virtual memory techniques are very similar.

VIRTUAL MEMORY A virtual-memory address translation method based on the concept of fixed-length pages is shown schematically in Figure Each virtual address generated by the processor, whether it is for an instruction fetch or an operand fetch/store operation, is interpreted as a virtual page number (high-order bits) followed by an offset (low-order bits) that specifies the location of a particular byte (or word) within a page. Information about the main memory location of each page is kept in a page table.

VIRTUAL MEMORY

This information include; the main memory address where the page is stored and the current status of the page. An area in the main memory that can hold one page is called a page frame The starting address of the page table is kept in a page table base register By adding the virtual page number to the contents of this register. the address of the corresponding entry in the page table is obtained. The contents of this location give the starting address of the page if that page currently resides in the main memory.

VIRTUAL MEMORY Each-entry in the page table also includes some control bits that describe the status of the page while it is in the main memory One bit indicates the validity of the page that is, whether the page is actually loaded in main memory This bit allows the operating system to invalidate the page without actually removing it

VIRTUAL MEMORY Another bit indicates whether the page has been modified during its resident in the memory as in cache memories, this information is needed to determine whether the page shotlid he written back to the disk before it is removed from the main memory to make room for another page.

VIRTUAL MEMORY Other control bits indicate various restrictions that may be imposed on accessing the page. For example, a program may be given full read and write permission, or it may be restricted to read accesses only.

VIRTUAL MEMORY The page table information is used by the MMU for every read and write access, so Ideally, the page table should be situated within the MMU. Unfortunately the page table may be rather large, and since the MMU is normally implemented as part of the CPU chip (along with the primary cache). it is impossible to include a complete age table on this chip. Therefore, the page table is kept in the main memory.

VIRTUAL MEMORY However a copy of a small portion of the page table can be accommodated within the MMU. This portion consists of the page table entries that correspond to the most recently accessed pages. A small cache, usually called the Translate look aside Buffer (TLB)

VIRTUAL MEMORY