Similar questions 2 more →
Virtual Memory & Paging

Answer & solution
Official answer: 6
Step through it (12 steps)
Step 1: Maintain recency on hits as well as on insertions. Write resident pages from least to most recently used. The first three references fault and produce [4], [4,7], [4,7,6]. Step 2: Reference 1 faults and evicts 4, giving [7,6,1]. The following hits on 7,6,1 change the order to [6,1,7], [1,7,6], [7,6,1]. Step 3: Reference 2 faults, evicting 7 and giving [6,1,2]. Next 7 faults, evicting 6 and giving [1,2,7]. Final 2 hits and gives [1,7,2]. Faults occur at positions 1,2,3,4,8,9: total 6.