1 / 12

VIRTUAL MEMORY

VIRTUAL MEMORY. Kautalya Mishra. Memory Hierarchy. Before Virtual Memory ? .

nerita
Download Presentation

VIRTUAL MEMORY

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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.htm • http://en.wikipedia.org/wiki/Virtual_memory

More Related