Back to the 2022 paper

Module 5: Memory Management

20227m

Consider the virtual page reference string 0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92 on a demand paged virtual memory system running on computer system that has main memory of size 4 page frames which one initially empty. The CPU uses LRU page replacement policy.
(i) How many page faults does this sequence cause?
(ii) What are the page numbers of the pages present in the main memory at the end of the sequence?

Worked SolutionAI Assisted

LRU with 4 frames, ref: 0,4,8,20,24,36,44,12,68,72,80,84,28,32,88,92

Simulating LRU: each new page faults until 4 distinct, then replace LRU.
Sequence: 0(F),4(F),8(F),20(F)=4,24(F replace 0),36(F replace4),44(F replace8),12(F replace20),68(F replace24),72(F replace36),80(F replace44),84(F replace12),28(F replace68),32(F replace72),88(F replace80),92(F replace84) => 16 faults (all references distinct except maybe? Actually all distinct, so 16 faults). Final pages in memory (order LRU→MRU): 28,32,88,92. If any repeated, faults reduce. Explanation shows LRU tracks recency stack.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.