Virtual memory is one of the most heavily tested topics in Operating Systems for BCS, bank IT-officer and other government IT posts. Almost every exam includes at least one question on page faults, page replacement algorithms (FIFO, LRU, Optimal), Belady's anomaly, or thrashing. Many of these are numerical questions where you must count page faults or compute Effective Memory Access Time (EMAT). This lesson builds every idea from first principles and shows every calculation step so you can answer both the theory MCQs and the numerical problems with confidence.
Learning Objectives
- Explain what virtual memory is and why operating systems need it.
- Recall how a virtual address is translated to a physical address.
- Define demand paging, the page fault, and list the exact steps the OS takes to service a fault.
- Compute page-fault rate and Effective Memory Access Time (EMAT) with full working.
- Explain swapping and swap space.
- Trace and count page faults for FIFO, Optimal, LRU, LFU and Clock (second-chance) on the same reference string.
- Demonstrate Belady's anomaly with a worked FIFO example (3 vs 4 frames).
- Explain thrashing, the CPU-utilization curve, and the working-set model.
- Describe frame-allocation strategies.