Question (BPSC (Ministry) — Assistant Maintenance Engineer — Exam: 2022): What is the relationship between Paging and Virtual memory?
a) Virtual memory came before Paging
b) When pages are created in disks, it is called a virtual memory
c) Virtual memory can never be implemented without paging
d) Paging is one technique for implementing virtual memory
Why it matters: Exams ask about virtual memory in two ways. One-mark MCQs check a single fact: where virtual memory lives, what a page fault is, why more RAM makes a computer feel faster, how paging relates to virtual memory, which command shows swap space. Written questions ask you to explain and to compute: what virtual memory is and why it is needed, physical against virtual memory with advantages and disadvantages, what a page fault is and when it happens, what demand paging is, what swapping is, and how much a page fault slows memory down. Each of these is taught below, together with its reason.
You bought a laptop with 8 GB of RAM. On an ordinary evening it has Chrome with twenty tabs open, an online class running in a video call, a PDF, a spreadsheet and a game launcher. Ask the system how much memory each of those programs believes it owns, and the answers add up to far more than 8 GB. Yet the laptop doesn't crash, and the video doesn't even stutter. Where did the extra memory come from?
It didn't come from anywhere. The programs were promised memory the machine does not physically have, and almost nobody notices, because the operating system keeps the promise only for the part of each program that is being used right now. This arrangement is called virtual memory. It is the reason a 4 GB program can run on a 2 GB machine, and it is one of the topics that bank and BCS papers ask about again and again.