Virtual Memory & Paging

Answer & solution
Official answer: 7
Step through it (13 steps)
1. Method and setup. On a fault with full memory, evict the resident page whose next reference is farthest in the future, treating never-used-again pages as infinitely far away. This uses future knowledge and is an optimal benchmark, not LRU. Mark hits explicitly so that each reference contributes at most one fault.
2. Work through the result and its assumptions. Load1, 2, 3 (three faults). At4 evict 3, whose next use is later than 1/2 (fourth fault). Hits2, 1 follow. At5 evict 1, never used again (fifth). At3 evict 5, never reused (sixth). Then2 and 4 hit; 6 causes the seventh fault. This is Belady’s farthest-future policy.

