What are the benefits of Virtual Memory

operating systemsvirtual-memory

So I've been reading up on virtual memory and it all seems pretty straight-forward and practical. However, I'm choking on one major concept.

If virtual memory is stored in main memory, then why even use it in the first place? Why not just use main memory?

I'm sure I'm missing something here, just don't understand what yet.

Best Answer

Virtual memory can be stored in RAM, but it can be swapped out to disk when another process needs the physical RAM. This is one of the significant features. Once it is on disk, other processes can use the system RAM to speed their processing. When needed, the memory swapped to disk can be reloaded and something else moved their in its place.

Many of today's computers have more RAM than they need so swapping is minimized (it can hurt performance), but it is good to have the swap option when needed.

Related Question