/
Computer ScienceComputer ScienceLast Class: Demand Paged VirtualMemory Computer ScienceComputer ScienceLast Class: Demand Paged VirtualMemory

Computer ScienceComputer ScienceLast Class: Demand Paged VirtualMemory - PDF document

calandra-battersby
calandra-battersby . @calandra-battersby
Follow
393 views
Uploaded On 2015-09-19

Computer ScienceComputer ScienceLast Class: Demand Paged VirtualMemory - PPT Presentation

Computer ScienceComputer Science Computer ScienceComputer Science Computer ScienceComputer ScienceSecond Chance Algorithm akaClockUse a single reference bit per page1OS keeps frames in a circu ID: 133227

Computer ScienceComputer Science Computer ScienceComputer Science Computer

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Computer ScienceComputer ScienceLast Cla..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Computer ScienceComputer ScienceLast Class: Demand Paged VirtualMemoryBenefits of demand paging:¥Virtual address space can be larger than physical address space.¥Processes can run without being fully loaded into memory.ÐProcesses start faster because they only need to load a few pages (for codeand data) to start running.ÐProcesses can share memory more effectively, reducing the costs when acontext switch occurs.¥A good page replacement algorithm can reduce the number ofpage faults and improve performanceCS377: Operating SystemsComputer ScienceComputer Science Computer ScienceComputer Science Computer ScienceComputer Science Computer ScienceComputer ScienceSecond Chance Algorithm: (a.k.a.Clock)Use a single reference bit per page.1.OS keeps frames in a circular list.2.On a page fault, the OSa)Checks the reference bit of the next frame.b)If the reference bit is Ô0Õ, replace the page, and set its bit to Ô1Õ.c)If the reference bit is Ô1Õ, set bit to Ô0Õ, and advance the pointer to the nextframeComputer ScienceComputer Science Computer ScienceComputer ScienceClock Example=� One way to view the clock algorithm is as a crudepartitioning into two categories: young and old pages.¥Why not partition pages into more than two categories?CS377: Operating SystemsComputer ScienceComputer Science Computer ScienceComputer ScienceEnhanced Second Chance¥The reference bit and modify bit form a pair (r,m) where1.(0,0) neither recently used nor modified - replace this page!2.(0,1) not recently used but modified - not as good to replace, since the OSmust write out this page, but it might not be needed anymore. Computer ScienceComputer ScienceClock ExampleCS377: Operating SystemsComputer ScienceLecture 18, page 14Computer ScienceReplacement Policies forMultiprogramming the memory is over-committed and pages arememory access times approach disk access times since many memoryreferences cause page faultsÐResults in a serious and very noticeable loss of performance.¥What can we do in a multiprogrammed environment to limitthrashing?¥Proportional allocation: allocate more page frames to largeprocesses.¥Global replacement: put all pages from all processes in one pool Computer ScienceComputer ScienceReplacement Policies forMultiprogramming Computer ScienceComputer Science