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.

Slides:



Advertisements
Similar presentations
Memory.
Advertisements

Part IV: Memory Management
Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
Memory Management Chapter 7. Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated efficiently to pack as.
Allocating Memory.
CS 311 – Lecture 21 Outline Memory management in UNIX
Day 20 Memory Management. Assumptions A process need not be stored as one contiguous block. The entire process must reside in main memory.
CS 153 Design of Operating Systems Spring 2015
Memory Management Design & Implementation Segmentation Chapter 4.
COMP5102/5122 Lecture 4 Operating Systems (OS) Memory Management phones off (please)
CS 104 Introduction to Computer Science and Graphics Problems
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
Memory Management 2010.
Memory Organization.
Memory Management (continued) CS-3013 C-term Memory Management CS-3013 Operating Systems C-term 2008 (Slides include materials from Operating System.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Chapter 9 Virtual Memory Produced by Lemlem Kebede Monday, July 16, 2001.
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
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. 
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 346, Royden, Operating System Concepts Operating Systems Lecture 24 Paging.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 32 Paging Read Ch. 9.4.
Operating Systems Chapter 8
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Chapter 7 Memory Management
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.
1 Address Translation Memory Allocation –Linked lists –Bit maps Options for managing memory –Base and Bound –Segmentation –Paging Paged page tables Inverted.
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
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 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Memory Management Operating Systems CS550. Memory Manager Memory manager - manages allocation and de-allocation of main memory Plays significant impact.
1 Memory Management Chapter 7. 2 Memory Management Subdividing memory to accommodate multiple processes Memory needs to be allocated to ensure a reasonable.
CS6502 Operating Systems - Dr. J. Garrido Memory Management – Part 1 Class Will Start Momentarily… Lecture 8b CS6502 Operating Systems Dr. Jose M. Garrido.
Memory management Ref: Stallings G.Anuradha. What is memory management? The task of subdivision of user portion of memory to accommodate multiple processes.
Memory Management OS Fazal Rehman Shamil. swapping Swapping concept comes in terms of process scheduling. Swapping is basically implemented by Medium.
Chapter 8: Main Memory. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 22, 2005 Memory and Addressing It all starts.
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.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Memory Management Chapter 5 Advanced Operating System.
Operating Systems Lecture 9 Introduction to Paging Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Virtual Memory By CS147 Maheshpriya Venkata. Agenda Review Cache Memory Virtual Memory Paging Segmentation Configuration Of Virtual Memory Cache Memory.
Chapter 8: Memory Management. 8.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 8: Memory Management Background Swapping Contiguous.
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
ITEC 202 Operating Systems
Chapter 2 Memory and process management
CS703 - Advanced Operating Systems
COMBINED PAGING AND SEGMENTATION
Day 19 Memory Management.
Main Memory Management
Chapter 8: Main Memory.
Segmentation Lecture November 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.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 32 Syed Mansoor Sarwar
Lecture 3: Main Memory.
2P13 Week 7.
COMP755 Advanced Operating Systems
Operating Systems: Internals and Design Principles, 6/E
Page Main Memory.
Presentation transcript:

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 Computer doesn’t have enough memory to handle multiple applications. Computer addresses more main memory than it actually has and store excess on an area of the hard drive called page file. Most common way to implement Virtual Memory is paging, segmentation and a combination of paging and segmentation.

Definitions. Virtual Address - The logical or program address that the process uses. Physical Address - The real address in the physical memory. Mapping - The mechanism to translate virtual address into physical. Page Frames - Equal size chunks that main memory is divided into. Pages - Equal size chunks that virtual memory is divided into - equal to the size of a page frame. Paging - Process of copying virtual page from disk to page frame in memory. Fragmentation - The memory that becomes unusable. Page Fault - Occurs when requested page is not in memory and must be copied from disk into memory.

Paging. Allocate physical memory to processes in fixed size chunks and keep track of where the various pages of the process reside by recording information in a page table. Every process has its own page table that typically resides in the main memory and the page table stores the physical location of each virtual page of the process.

Paging contd. If there are pages of process currently not in the main memory, the page table sets the valid bit to 0; or if the page is already in the main memory then the valid bit is set to 1. More fields can also bee added to relay more information. Example: A modify bit can be added to indicate if the page has been changed.

How paging works. When a process generates a virtual address, the operating system must dynamically translate this virtual address into a physical address in memory at which the data actually resides. To accomplish the address translation, a virtual address is split into a page field and a offset field.

Example of Paging A B C D E F G H I J K L M N O P C D G H A B K L Main Memory Address Program Address Space Page Table Virtual Address = Physical Address Frame Valid Bit Page Page Frame bits( Holds Value K) 3 bits

Advantages and Disadvantages of Paging AdvantagesDisadvantages 1.Easy to allocate memory. 2.Easy to “page out” chunks of programs. 1. Can still have internal fragmentation. 2.Memory reference overhead 3.Memory Required to hold page tables can be large.

Segmentation In segmentation, virtual address space is divided into logical, variable length units called segments. When segment needs to be copied into physical memory, the OS looks for chunk of free memory large enough to store the entire segment. A segment has a base address, indicating its location in memory, and a bounds limit indicating its size. Similar to Paging, Each program consisting of multiple segments, now has an associated Segment table.

External Fragmentation in Segmentation As segments are allocated and de-allocated, the free chunks that reside in memory become broken up. There are many small chunks, but none large enough to store an entire segment. To combat this, the systems use some sort of garbage collection. Garbage collection basically shuffles occupied chunks of memory to turn the smaller, fragmented chunks into larger, usable chunks. (Similar to defragmenting a hard drive)

Combination of Paging and Segmentation Virtual Address space is divided into segments of variable lengths, and the segments are divided into fixed- size pages. main memory is divided into the same size frames. Thus, each segment has a page table, which means every program has multiple page tables. Physical Address is divided into 3 fields: the segment field to point to the appropriate page table, the page number to offset into this page table and the offset within the page. Combined, Paging and segmentation is very advantageous as it allows for segmentation from user point of view and paging from system’s point of view.