Virtual Memory By Steven LaBarbera. What I plan to cover  The history of virtual memory  How virtual memory has evolved  How virtual memory is used.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Allocating Memory.
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
OS Fall’02 Memory Management Operating Systems Fall 2002.
OS Spring ‘04 Paging and Virtual Memory Operating Systems Spring 2004.
CS 333 Introduction to Operating Systems Class 11 – Virtual Memory (1)
CS 104 Introduction to Computer Science and Graphics Problems
Memory Management 2010.
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.
Memory Management Chapter 5.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
Computer Organization and Architecture
Memory Management Five Requirements for Memory Management to satisfy: –Relocation Users generally don’t know where they will be placed in main memory May.
Virtual Memory Deung young, Moon ELEC 5200/6200 Computer Architecture and Design Lectured by Dr. V. Agrawal Lectured by Dr. V.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
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,
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.
Virtual Memory By: Dinouje Fahih. Definition of Virtual Memory Virtual memory is a concept that, allows a computer and its operating system, to use a.
CSE378 Virtual memory.1 Evolution in memory management techniques In early days, single program ran on the whole machine –used all the memory available.
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.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Review of Memory Management, Virtual Memory CS448.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally MEMORYMANAGEMNT.
Memory Management Chapter 7.
Operating Systems Chapter 8
MEMORY MANAGEMENT Presented By:- Lect. Puneet Gupta G.P.C.G. Patiala.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Chapter 7 Memory Management
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
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.
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.
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.
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.
Memory Management Fundamentals Virtual Memory. Outline Introduction Motivation for virtual memory Paging – general concepts –Principle of locality, demand.
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.
Computer Systems Week 14: Memory Management Amanda Oddie.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
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.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Lectures 8 & 9 Virtual Memory - Paging & Segmentation System Design.
Virtual Memory Pranav Shah CS147 - Sin Min Lee. Concept of Virtual Memory Purpose of Virtual Memory - to use hard disk as an extension of RAM. Personal.
Operating Systems Session 7: – Virtual Memory organization Operating Systems.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Memory Management Chapter 5 Advanced Operating System.
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.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Computer Organization
Memory Management.
Chapter 8: Main Memory.
Lecture 28: Virtual Memory-Address Translation
O.S Lecture 13 Virtual Memory.
Computer Architecture
Module IV Memory Organization.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 3: Main Memory.
Virtual Memory 1 1.
Page Main Memory.
Presentation transcript:

Virtual Memory By Steven LaBarbera

What I plan to cover  The history of virtual memory  How virtual memory has evolved  How virtual memory is used today  Why is virtual memory important

History of virtual memory  Early computers used a two-level storage system consisting of main memory and secondary memory.  main memory (RAM) for the first computers were magnetic cores.  The secondary memory (hard disks) were magnetic drums.

History of virtual memory  Early in computers infancy memory was neither inexpensive nor easy to find.  the most sophisticated computers were lucky to have 128 kilobytes of memory, a fraction of what a floppy disk can hold.  This lack of space had serious implications on older systems processing power.

Why did lack of space have serious implications?  Programmers had to re-code their program every time they switched machines or added more memory.

How did they deal with this?  programmers divided programs into sections that were transferred into main memory for a period of processing time. As the program proceeded, new sections moved into main memory and replaced sections that were not needed. In this early era of computing, the programmer was responsible for devising this overlay system. overlay system

The creation of virtual memory  The technique was invented at the University of Manchester for the Atlas Computer, completed in 1962.University of ManchesterAtlas Computer1962

How virtual memory works  when a memory location is read or written to hardware within the computer translates the memory address generated by the software (the virtual memory address) into a, usually distinct, real memory addresshardware

Continued  This is accomplished by preserving the low order bits of the binary representation of the input address while treating the high order bits as a key to one or more address translation tables.  a range of consecutive addresses in the virtual address space whose size is a power of two will be translated in a corresponding range of consecutive physical addresses.power of two

Simple Paging  The memory referenced by such a range is called a page  In a simple paging system you view the users program as consisting of fixed length blocks  The page size is typically in the range of 512 to 8192 bytes

Simple Paging  In a paging system consider the addresses as consisting of two components. 1.The page number 2.The displacement into the page Page 0 0FFF Page 1 1FFF Page 2 2FFF Page 3 3FFF

The displacement component  This must be big enough to hold any displacement within a page.  Example 2^12 – byte (4k) page size, the displacement of this has to hold 2^12 – 1.  Thus a 2^12 displacement requires a 12 bit (3 hex digit) displacement field 2^n page requires n-bit displacement field

Translation from virtual memory to physical memory  Translations are managed by the Memory Management Unit (MMU).

Translation from virtual memory to physical memory  ( 1 ) or "logical address" consisting of a logical page number plus the location within that page (x) must be interpreted or "mapped" onto an actual (physical) main memory address by the operating system using an address translation function or mappermapper

Translation from virtual memory to physical memory  ( 2 ) If the page is present in the main memory, the mapper substitutes the physical page frame number for the logical number

Translation from virtual memory to physical memory  ( 3 ) If the mapper detects that the page requested is not present in main memory, a fault occurs and the page must be read into a frame in main memory from secondary storage ( 4, 5 ).

What does the mapper do? translates the logical page number generated by the program into the physical page frame number where the main memory holds the pagelogical page number

What does the mapper do? This translation is accomplished by using a directly indexed table called the page table which identifies the location of all the program's pages in the main store page table

Page Table  As the operating system loads pages of a user program into memory, it uses a page table to keep track of the location of each page.  A page table is a one-dimensional array in main memory that contains a slot for every page in the users program.

Page Table  the page table shows that pages 0,1,2, and 3 are in frames 4,6,2,and 5 Page Number Frame Number

DAT Unit  In the book the DAT Unit is used to translate virtual addresses to physical addresses.  Dynamic Address Translation Unit

Paging pros and cons Pros Eliminates memory fragmentation problems seen in multiprogramming systems. Paging systems do not have compaction overhead that systems with relocation have. Cons Has to do two operations every time CPU fetches an item from memory. 1.Obtain page number from page table. 2.Obtain desired item from main memory at the computed physical address.

How they fix this inefficiency  Carefully designing the DAT Unit.  Every time CPU fetches an item from memory you keep a copy of the page table in a local memory area of the DAT Unit.  So every time a DAT Unit translates an address from the program, it can get the framer number from local memory.

Demand Paging  Each page table contains two parts 1.The frame number 2.A valid bit

Valid bit field The valid bit indicates if the corresponding page is in memory. 0 = not in memory 1= in memory

Why is Virtual Memory Important?  The advantage of virtual memory is that it allows a computer to multiplex its CPU and memory between multiple programs without the need to perform expensive copying of the programs' memory images. If the combination of virtual memory system and operating system supports swapping, then the computer may be able to run simultaneously programs whose total size exceeds the available physical memory.

Review  when a memory location is read or written to hardware within the computer translates the memory address generated by the software (the virtual memory address) into a, usually distinct, real memory address hardware

Review  MMU or Memory Management Unit  DAT Unit or Dynamic Address Translation Unit These are the techniques used to translate a virtual address to a physical address.

Review  Simple Paging Fixed length blocks Holds page number Displacement field  Demand Paging Holds frame number Boolean valid bit 1 = in memory 0= not in memory

References  Virtual Memory Tutorial history.html history.html  Virtual Memory Modulehttp://cne.gmu.edu/modules/vm/