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.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 36 Virtual Memory Read.
Chapter 7 Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2009, Prentice.
Memory Management Design & Implementation Segmentation Chapter 4.
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.
Chapter 7 Memory Management
Lecture 11: Memory Management
Memory Management 2010.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
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.
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.
CSI 400/500 Operating Systems Spring 2009 Lecture #9 – Paging and Segmentation in Virtual Memory Monday, March 2 nd and Wednesday, March 4 th, 2009.
Computer Organization and Architecture
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.
Chapter 91 Translation Lookaside Buffer (described later with virtual memory) Frame.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 9 – Real Memory Organization and Management Outline 9.1 Introduction 9.2Memory Organization.
Chapter 7 Memory Management
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.
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. 
Chapter 3 Memory Management: Virtual Memory
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
Memory Management Chapter 7.
1 Memory Management Memory Management COSC513 – Spring 2004 Student Name: Nan Qiao Student ID#: Professor: Dr. Morteza Anvari.
Memory Management Operating Systems: Internals and Design Principles, 6/E William Stallings Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Dr.
Topics covered: Memory subsystem CSE243: Introduction to Computer Architecture and Hardware/Software Interface.
Chapter 7 Memory Management
Memory Management – Page 1 of 49CSCI 4717 – Computer Architecture Memory Management Uni-program – memory split into two parts –One for Operating System.
Page 1 2P13 Week 5. Page 2 Page 3 Page 4 Page 5.
Subject: Operating System.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
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.
Virtual Memory. Background Virtual memory is a technique that allows execution of processes that may not be completely in the physical memory. Virtual.
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.
Swap Space and Other Memory Management Issues Operating Systems: Internals and Design Principles.
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.
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.
Chapter 7 Memory Management Eighth Edition William Stallings Operating Systems: Internals and Design Principles.
Memory Management Chapter 5 Advanced Operating System.
1 Memory Management n In most schemes, the kernel occupies some fixed portion of main memory and the rest is shared by multiple processes.
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.
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.
Chapter 7 Memory Management
Lesson Objectives Aims Key Words Paging, Segmentation, Virtual Memory
Computer Organization
Memory Management.
ITEC 202 Operating Systems
Chapter 2 Memory and process management
Chapter 8: Main Memory.
CSE 120 Principles of Operating
Chapter 9 – Real Memory Organization and Management
Computer Architecture
Module IV Memory Organization.
Main Memory Background Swapping Contiguous Allocation Paging
Lecture 3: Main Memory.
Operating System Chapter 7. Memory Management
Memory management Explain how memory is managed in a typical modern computer system (virtual memory, paging and segmentation should be described.
2P13 Week 7.
COMP755 Advanced Operating Systems
Student : Yan Wang student ID:
Presentation transcript:

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 became popular.  In 1961, virtual memory was proposed to solve the problem of storage allocation.

Definition  Virtual memory is a memory management system that gives a computer the appearance of having more main memory than it really has.

Advantages  Main memory is used more efficiently. Only those portions of an executing program that are in use occupy main memory.  Programs that are bigger than main memory can still be executed

Implementation of Virtual Memory  The virtual memory abstraction is implemented by using secondary storage to augment the processor's main memory.  Data is transferred from secondary to main storage when necessary and the data replaced is written back to the secondary storage.

Implementation of Virtual Memory  If the data swapped is designated a fixed size, this swapping is called paging.  if variable sizes are permitted and the data is split along logical lines, it is called segmentation.  Some operating systems combine segmentation and paging.

Paging  In a simple paging system view,  user programs consists of fixed-length blocks called pages.  Main memory consists of fixed-length blocks called frames.  When an operating system loads a user program into memory, it loads each page into any available frame.

Page Table  To keep track of the location of each page in the memory, the operating system builds a one-dimensional array called Page Table.

Page Number Frame Number Valid bit means not in memory

Mapper  The mapper is the part of the operating system that translates the logical page number generated by the program into the physical page frame number where the main memory holds the page.  This translation is accomplished by using page table. If the page table reveals that the page is not resident in the main memory, the mapper issues a page fault to the operating system so that execution is suspended on the process until the desired page can be read in from the secondary storage and placed in main memory.

Page in  The corresponding operation of reading them in again later when one of the pages is referenced is called a page in.

Page out  The operation of writing one inactive page, or a cluster of inactive memory pages to disk is called a page out.

Advantages  Paging is effective because programs typically only use a small proportion of their virtual memory pages actively at any one a time.  Allows a program that is too big to fit into memory to be executed

Disadvantages  Once the memory is allocated for modules they cannot vary in size. This restriction results in either wastage or shortage of memory.  In paging system, stack is put at the top of its logical address space; data and code are put at the bottom. The gap between them requires a page table that is too big.

Segmentation  the program is divided into functional segments such as code segment, stack segment, data segment…

Segmentation  some computer systems have their main memory divided into many independent address spaces. Each of these address spaces is called a segment. The address of each segment begins with 0 and segments may be compiled separately.

Segmentation  Each segment in the program can be transferred into segments in main memory. However, it may happen that the program segment is too big to fit in main memory segment.

Segmentation with Paging  Some operating systems allow for the combination of segmentation with paging. If the size of a segment exceeds the size of main memory, the segment may be divided into equal size pages.

Segmentation with Paging  Each segment has its own page table.  The used gap in the address space would not be represented by any page table.

Virtual Address  The address consists of three parts:  (1) segment number  (2) the page within the segment  (3) the offset within the page.  The segment number is used to find the segment descriptor and the address within the segment is used to find the page frame and the offset within that page.

Comparison between Paging and Segmentation  SEGMENTATION  Involves programmer  Separate compiling  Separate protection  Shared code  PAGING  Transparent to programmer  No separate compiling  No separate protection  No shared code