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.

Slides:



Advertisements
Similar presentations
Memory Management: Overlays and Virtual Memory
Advertisements

Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
16.317: Microprocessor System Design I
Virtual Memory Chapter 18 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S. Dandamudi.
Computer Organization CS224 Fall 2012 Lesson 44. Virtual Memory  Use main memory as a “cache” for secondary (disk) storage l Managed jointly by CPU hardware.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
The Memory Hierarchy (Lectures #24) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer Organization.
Memory Management (II)
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Memory Management -3 CS 342 – Operating Systems Ibrahim Korpeoglu Bilkent.
Recap. The Memory Hierarchy Increasing distance from the processor in access time L1$ L2$ Main Memory Secondary Memory Processor (Relative) size of the.
Chapter 3.2 : Virtual Memory
Virtual Memory. Why do we need VM? Program address space: 0 – 2^32 bytes –4GB of space Physical memory available –256MB or so Multiprogramming systems.
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.
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.
CS 241 Section Week #12 (04/22/10).
Address Translation Mechanism of 80386
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Computer Architecture Lecture 28 Fasih ur Rehman.
Some VM Complications Extra memory accesses Page tables are huge
Lecture 19: Virtual Memory
1 Chapter 3.2 : Virtual Memory What is virtual memory? What is virtual memory? Virtual memory management schemes Virtual memory management schemes Paging.
IT253: Computer Organization
Operating Systems COMP 4850/CISG 5550 Page Tables TLBs Inverted Page Tables Dr. James Money.
Fall 2000M.B. Ibáñez Lecture 17 Paging Hardware Support.
8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Paging Physical address space of a process can be noncontiguous Avoids.
CS 149: Operating Systems March 3 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 4 Memory Management Virtual Memory.
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.
1 Virtual Memory Main memory can act as a cache for the secondary storage (disk) Advantages: –illusion of having more physical memory –program relocation.
80386DX.
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
Virtual Memory 1 1.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
Introduction to Virtual Memory and Memory Management
Operating Systems Unit 7: – Virtual Memory organization Operating Systems.
4.3 Virtual Memory. Virtual memory  Want to run programs (code+stack+data) larger than available memory.  Overlays programmer divides program into pieces.
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.
CS2100 Computer Organisation Virtual Memory – Own reading only (AY2015/6) Semester 1.
Memory Management: Overlays and Virtual Memory. Agenda Overview of Virtual Memory –Review material based on Computer Architecture and OS concepts Credits.
Virtual Memory Ch. 8 & 9 Silberschatz Operating Systems Book.
CHAPTER 3-3: PAGE MAPPING MEMORY MANAGEMENT. VIRTUAL MEMORY Key Idea Disassociate addresses referenced in a running process from addresses available in.
Jeffrey Ellak CS 147. Topics What is memory hierarchy? What are the different types of memory? What is in charge of accessing memory?
The Memory Hierarchy Lecture 31 20/07/2009Lecture 31_CA&O_Engr. Umbreen Sabir.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
Memory Management & Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
CS161 – Design and Architecture of Computer
VIRTUAL MEMORY.
Lecture 11 Virtual Memory
Memory Management Virtual Memory.
Memory Management.
Memory COMPUTER ARCHITECTURE
CS161 – Design and Architecture of Computer
Virtual Memory User memory model so far:
From Address Translation to Demand Paging
Address Translation Mechanism of 80386
CSCI206 - Computer Organization & Programming
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
From Address Translation to Demand Paging
Module IV Memory Organization.
Lecture 29: Virtual Memory-Address Translation
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
CSE451 Virtual Memory Paging Autumn 2002
Virtual Memory Prof. Eric Rotenberg
4.3 Virtual Memory.
Memory Management & Virtual Memory
Virtual Memory 1 1.
Presentation transcript:

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 very large range of memory or storage addresses for stored data. The computing system maps the programmer's virtual addresses to real hardware storage addresses (Hard Disks). In addition to managing the mapping of virtual storage addresses to real storage addresses, a computer implementing virtual memory or storage also manages storage swapping between active storage (RAM) and hard disk or other high volume storage devices

All modern general-purpose computer operating systems use virtual memory techniques for ordinary applications, such as word processors, spreadsheets, multimedia players, accounting, etc All modern general-purpose computer operating systems use virtual memory techniques for ordinary applications, such as word processors, spreadsheets, multimedia players, accounting, etc Older operating systems, such as DOS of the 1980s, or many mainframe operating systems of the 1960s, had no virtual memory functionality. Older operating systems, such as DOS of the 1980s, or many mainframe operating systems of the 1960s, had no virtual memory functionality. Embedded Systems and other special-purpose computer systems which require very fast, very consistent response time do not generally use virtual memory. Embedded Systems and other special-purpose computer systems which require very fast, very consistent response time do not generally use virtual memory.

Computer Memory Hierarchy

Virtual Memory Usage. Memory Extension Memory Extension Memory Protection Memory Protection

How Does it Work?  Memory Management Unit (MMU) Hardware component responsible for handling accesses to memory requested by the (CPU). One of Its functions include translation of virtual addresses to physical addresses (Virtual Memory management),

► Virtual Memory provides expansion of Main Memory by ‘overflowing’ data and program code onto Magnetic Disk. ► The area on disk reserved for this purpose is known as the Swap Space ► Dividing main memory into Frames (pages)

Pages Pages The RAM physical memory subdivided into 4kb-64kb pages. 512MB/4K = pg Page Table Page Table provides a look up whereby the logical page number can be exchanged for the physical frame number. It is an Array of (PTE). It is an Array of (PTE).

Process Process When programs are using the CPU at the same time, each running program and the data structures needed to manage it. When programs are using the CPU at the same time, each running program and the data structures needed to manage it. Addresses Addresses A Load Instruction A Load Instruction A Store Instruction A Store Instruction Fetching an Instruction Fetching an Instruction

Maximum Virtual Address space: Size of a program address is determined by the maximum size of the virtual address space. The number of bits in a virtual address is the log base 2 of this value. Size of a program address is determined by the maximum size of the virtual address space. The number of bits in a virtual address is the log base 2 of this value. Maximum Physical Address space: The amount of real memory that the system can support determined the number of bits needed to address the physical memory. The size of physical address is log base 2 of this value. Size of a Page: This is the size of a virtual memory page and a physical memory frame. It is always a power of 2 Virtual Memory Address Translation

Page number and page offset A virtual address is therefore split into two parts. The more significant part gives the page number. The less significant part gives the address of the byte within the page. The less significant part is also called the “page offset.” A virtual address is therefore split into two parts. The more significant part gives the page number. The less significant part gives the address of the byte within the page. The less significant part is also called the “page offset.” The number of bits allocated to the page offset should be able to address every byte in the page. Therefore, in our example. Since we have 4 KB = 2 12 byte page tables, we need 12 bits for page offset. The number of bits allocated to the page offset should be able to address every byte in the page. Therefore, in our example. Since we have 4 KB = 2 12 byte page tables, we need 12 bits for page offset. Likewise for the physical address. Likewise for the physical address.

13 bits 10 bits page number offset 16MB Maximum Virtual Address space (24 bits) 8MB Maximum Physical Address space (23 bits) 1024byte Page size (10 bits) Virtual Address can be represented as: 16MB Maximum Virtual Address space (24 bits) 8MB Maximum Physical Address space (23 bits) 1024byte Page size (10 bits) Virtual Address can be represented as:

Page Fault The memory manager locates the missing page in secondary memory. The memory manager locates the missing page in secondary memory. The page is loaded into primary memory, usually causing another page to be unloaded. The page is loaded into primary memory, usually causing another page to be unloaded. The page table in the memory manager is adjusted to reflect the new state of the memory. The page table in the memory manager is adjusted to reflect the new state of the memory. The processor re-executes the instructions which caused the page fault. The processor re-executes the instructions which caused the page fault.

Translation Look-aside Buffer The TLB tends to be fully associative. The TLB uses write-back. Therefore, needs a dirty bit to indicate if the page is dirty Or have a Read or Write Permission bit This is because a TLB miss is very costly, and is to be avoided.

MEMORY PERFORMANCE COMPARISON

How to Access the Virtual Memory in your Computer? 1

2 3

4RAM Virtual Mem. 1GB 1536MB 2048MB 2GB3072MB4096MB 3GB4644MB6144MB

Conclusion! Questions??