Kautalya Mishra - PowerPoint PPT Presentation

About This Presentation
Title:

Kautalya Mishra

Description:

The basic idea of Virtual Memory is to keep only those parts of the program ... Design and Management Andrew S. Tanenbaum and Albert S. Woodhull http ... Company ... – PowerPoint PPT presentation

Number of Views:108
Avg rating:3.0/5.0
Slides: 13
Provided by: Kaut3
Category:

less

Transcript and Presenter's Notes

Title: Kautalya Mishra


1
VIRTUAL MEMORY



  • Kautalya Mishra

2
Memory Hierarchy
3
Before Virtual Memory ?
  • Programmers when confronted with the problem of
    having programs that were too big to fit in to
    the available memory came up with a solution of
    splitting the program in to pieces called
    Overlays.
  • Overlay 0 would start running first followed by
    the next overlay. The overlays were kept on the
    disk and swapped in and out of the memory by the
    operating system dynamically.
  • Although the work of swapping Overlays in and out
    was done by the system, the LABORIOUS work of
    splitting the program in to Overlays had to be
    done by the programmer.

4
Virtual Memory
  • The basic idea of Virtual Memory is to keep only
    those parts of the program currently in use in
    the memory and the rest on the disk drive.
  • For example a 16M program can run on a 4M
    machine by carefully choosing which 4M to keep in
    memory at each instant, with pieces of the
    program being swapped between disk and memory as
    needed.
  • It can work in a Multiprogramming system, with
    bits and pieces of many programs brought to the
    memory at once by the Operating System. While a
    program is waiting for part of itself to be
    brought in, it is waiting for I/O and cannot run,
    so the CPU can be given to another process, the
    same way as for any other multiprogramming system.

5
Virtual Memory implemented using PAGING
6
  • The position and function of the MMU

7
Virtual Address Space
8
Internal operation of a MMU
9
Page Faults
  • When a page being referred to by the virtual
    address is not loaded as a page frame in to the
    memory, a page fault is occurred which causes the
    CPU to trap the Operating System.
  • The Operating System removes a page frame from
    the memory and loads the new page in to the freed
    location at the same time making appropriate
    changes to the page table.
  • There are a number of page replacement algorithms
    available such as The Optimal Page Replacement
    Algo, The Not Recently Used Page Replacement
    Algo, FIFO etc.

10
  • Problems faced with Virtual Memory
    implementation
  • Possibly large page table
  • Thrashing
  • Solution
  • Use multilevel page tables.
  • Use TLB (Translation Lookaside Buffer) or
    sometimes called Associative Memory.
  • Page fault rates can be reduced by using a
    Working Set Model approach or a Prepaging
    approach.
  • Increase RAM!

11
Advances Made ?
  • Some advanced systems give programmers some
    control over the memory map so that they can used
    it in a non-traditional way. It allows for the
    possibility of sharing the same memory space
    between two or more processes.
  • Distributed Shared Memory The idea here is to
    allow multiple processes over a network to share
    a set of pages, possibly, but not necessarily, as
    a single shared linear address space

12
References
  • Operating Systems Design and Management Andrew
    S. Tanenbaum and Albert S. Woodhull
  • http//computer.howstuffworks.com/virtual-memory.h
    tm
  • http//en.wikipedia.org/wiki/Virtual_memory
Write a Comment
User Comments (0)
About PowerShow.com