1 / 18

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory. Operating Systems: Internals and Design Principles. Video tutorial. http:// www.youtube.com/watch?v=iqfjWIYyQ9k http://www.youtube.com/watch?v=4px3RrDBa6w. Real and Virtual Memory. Operating System Software. Policies for Virtual Memory. Key issue: Performance

vega
Download Presentation

Chapter 8 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. Chapter 8Virtual Memory Operating Systems:Internals and Design Principles Seventh Edition William Stallings

  2. Video tutorial • http://www.youtube.com/watch?v=iqfjWIYyQ9k • http://www.youtube.com/watch?v=4px3RrDBa6w

  3. Real and Virtual Memory

  4. Operating System Software

  5. Policies for Virtual Memory • Key issue: Performance • minimize page faults (desired page is not in main memory)

  6. Replacement Policy • Deals with the selection of a page in main memory to be replaced when a new page must be brought in • objective is that the page that is removed be the page least likely to be referenced in the near future • The more elaborate the replacement policy the greater the hardware and software overhead to implement it

  7. Basic Algorithms

  8. Optimal Policy • Selects the page for which the time to the next reference is the longest • Produces three page faults after the frame allocation has been filled 1 is replaced as 1 will be not appeared after 5

  9. Least Recently Used (LRU) • Replaces the page that has not been referenced for the longest time • By the principle of locality, this should be the page least likely to be referenced in the near future • Difficult to implement • one approach is to tag each page with the time of last reference • this requires a great deal of overhead

  10. LRU Example

  11. First-in-First-out (FIFO) • Treats page frames allocated to a process as a circular buffer • Pages are removed in round-robin style • simple replacement policy to implement • Page that has been in memory the longest is replaced

  12. FIFO Example

  13. Clock Policy • Requires the association of an additional bit with each frame • referred to as the use bit • Uses and additional bit called a “use bit” • When a page is first loaded in memory or referenced, the use bit is set to 1 • When it is time to replace a page, the OS scans the set flipping all 1’s to 0 • The first frame encountered with the use bit already set to 0 is replaced.

  14. Clock Policy Example

  15. Clock Policy

  16. Clock Policy

  17. Combined Examples

  18. Summary • Desirable to: • maintain as many processes in main memory as possible • free programmers from size restrictions in program development • With virtual memory: • all address references are logical references that are translated at run time to real addresses • a process can be broken up into pieces • two approaches are paging and segmentation • management scheme requires both hardware and software support

More Related