Your SlideShare is downloading. ×
  • Like
Virtual Memory
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply


Published in Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Virtual Memory
  • 2. Overview ● Background ● Demand Paging ● Process Creation ● Page Replacement Operating System 2011/2012
  • 3. Background Virtual memory – separation of user logical memory from physical memory. ● ● ● ● Only part of the program needs to be in memory for execution. Logical address space can therefore be much larger than physical address space. Allows address spaces to be shared by several processes. Allows for more efficient process creation. Operating System 2011/2012
  • 4. Virtual to physical mapping Operating System 2011/2012
  • 5. Demand Page Bring a page into memory only when it is needed. ● Less I/O needed ● Less memory needed ● Faster response ● More users Page is needed → reference to it invalid reference → abort not-in-memory → bring to memory ● ● Operating System 2011/2012
  • 6. Transfer page Operating System 2011/2012
  • 7. Valid/Invalid Bit With each page table entry a valid–invalid bit is associated (1 → in-memory, → not-in-memory) ● Initially valid–invalid but is set to 0 on all entries. ● Example of a page table snapshot. ● During address translation, if valid–invalid bit in page table entry is 0 ⇒ page fault. ● Operating System 2011/2012
  • 8. Valid/Invalid Bit Operating System 2011/2012
  • 9. Page Fault Operating System 2011/2012
  • 10. Memory full ● Page replacement – find some page in memory, but not really in use, swap it out. ● ● ● algorithm performance – want an algorithm which will result in minimum number of page faults. Same page may be brought into memory several times. Operating System 2011/2012
  • 11. Copy-on-Write Copy-on-Write (COW) allows both parent and child processes to initially share the same pages in memory. If either process modifies a shared page, only then is the page copied. COW allows more efficient process creation as only modified pages are copied. Free pages are allocated from a pool of zeroed-out pages. Operating System 2011/2012
  • 12. Page replacement ● FIFO Page Replacement ● Optimal Page Replacement ● LRU Page Replacement ● LRU – Approximation Page Replacement ● ● ● Additional-Reference-Bits Algorithm Second-Chance Algorithm Counting-Based Page Replacement ● ● least-frequently-used (LFU) most-frequently-used (MFU) Operating System 2011/2012