Memory
Virtual memory is a reserved area of secondary storage that the computer uses as extra RAM when RAM is full. It is only used then: if everything running fits in RAM, virtual memory is never touched. A computer with no secondary storage cannot use it at all, because virtual memory has to be set aside on secondary storage.
RAM fills up when you have lots of programs open or are working with large files. Without virtual memory, the computer would have to refuse to open anything else, and programs already running could stop working or crash. Instead, the operating system moves data you are not using just now out of RAM and into virtual memory, freeing space in RAM.
When you go back to that data, it is copied back into RAM while other unused data is moved out to make room. This swapping happens constantly. The CPU can only process data that is in RAM, so anything in virtual memory has to be copied back first.
For example, a music studio mixing a multi-track recording has RAM full. The tracks that are currently muted are not needed, so the operating system moves some of that audio data into virtual memory. Switching a muted track back on brings a brief pause while its data is copied into RAM so the CPU can process it.
Extra RAM reduces the need for virtual memory, because more of the running software fits in RAM. It only speeds up a computer that was already filling RAM and swapping data out. If RAM was never full, adding memory makes little visible difference.
OCR GCSE Computer Science · Memory