When a running process experiences a page fault, the frame to hold the missing p
ID: 3793165 • Letter: W
Question
When a running process experiences a page fault, the frame to hold the missing page can only
come from those frames allocated to that process, not from frames used by any other
process. The memory system chooses which frame to use using a simple first-in first-out
technique. That is, the first time it must choose a frame to use to hold a page being
loaded to resolve a page fault, it chooses the first frame it loaded originally. The second
page fault then uses the now ‘oldest’ frame (the second one that had been loaded originally),
and so on: the first frame (originally) loaded becomes the first frame ‘out’ (i.e., to be reused).Each page fault causes only the one missing page to be loaded.
Now suppose a program is executing a straight, linear sequence of instructions that is 100 KB
long. This process is allocated 20 frames when put into memory. How many page faults
will there be to completely execute this sequence of instructions?
Explanation / Answer
each frame contains 100kb and frames allocated is 20 frames.
each block contains 100/20=5 frames.
reference string be 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19.
in first step 0,1,2,3,4 page faults occur beacuse initial no of page faults are 5 then,
then again new pages need to be replaced again since these pages are not avialaible then again 5 page faults occur for 5,6,7,8,9,10.so again 5 page faults occur.
ow in total 10 page faults occur.11,12,13,14,15 then again 5 page faults occur because these again will not be avialible.so again 5 page faults occur.now in 15 faults occurs.
now 16 17 18 19 20 now again 5 more page faults occurs .so in total 20 page faults occur since they are not avilable in stack.
so continuosly 20 page faults occurs if we consider our own set of reference strings as mentioned above..
it changes again again according to string
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.