- Virtual memory separates logical memory from physical memory: only part of a program needs to be in memory.
- Demand paging: load a page only when it is needed (lazy swapper / pager).
- Valid–invalid bit: v = in memory, i = not in memory (or not legal).
- Referencing an invalid page → page fault trap to the OS.
- Handling: trap → check the reference → find a free frame → read the page from disk → update the table, set v → restart the instruction.
🎯 How this can come up · 1 question
After the page is loaded, the OS:
Correct: Restarts the faulting instruction.
- EAT = (1 − p)·memory access + p·page-fault time. Even a tiny p hurts because a fault costs milliseconds.
🎯 How this can come up · 1 question
Memory 200 ns, fault service 8 ms, p = 0.001. EAT ≈
0.999·200 + 0.001·8,000,000 ≈ 8,200 ns.
- Page replacement: if no free frame, pick a victim; use a dirty (modify) bit so only modified pages are written back.
- Goal: lowest page-fault rate. Evaluate on a reference string.
- FIFO: replace the oldest page.
- Belady’s anomaly: with FIFO, MORE frames can cause MORE page faults.
🎯 How this can come up · 1 question
Belady’s anomaly occurs with:
Correct: FIFO.
- Optimal (OPT/MIN): replace the page not used for the longest time in the future. Lowest fault rate but needs the future: used as a benchmark.
🎯 How this can come up · 1 question
The optimal page-replacement algorithm can be implemented in a real OS.
False. It needs future knowledge.
- LRU: replace the page not used for the longest time in the past. Implemented with counters or a stack; no Belady’s anomaly.
🎯 How this can come up · 1 question
Reference string 1 2 3 4 1 2 5 1 2 3 4 5 with 3 frames. Count FIFO page faults.
9 faults (and 10 with 4 frames: Belady’s anomaly).
- Thrashing: the process spends more time paging than executing because it has too few frames; CPU utilization drops.
🎯 How this can come up · 1 question
Thrashing is when a process:
Correct: Spends more time paging than executing.
No slides match this filter.












