Virtual memory is a memory management technique in which the operating system gives each process its own address space and maps those addresses to physical RAM or, when RAM runs short, to a file or partition on disk. This disk area is called the page file on Windows and swap on Linux and macOS.
Why it matters
It lets a computer run more programs than fit in RAM, isolates processes from one another and simplifies programming. Disk is far slower than RAM, even on an SSD, so heavy reliance on swapping makes the system sluggish, a condition called thrashing. Adding RAM is usually the real fix for constant swapping.
Example
On Linux, free -h shows memory and swap:
total used free
Mem: 16Gi 9.2Gi 1.1Gi
Swap: 4.0Gi 1.5Gi 2.5Gi
Here, 1.5 GiB of less-used memory has been moved to disk. On Windows, the page file is pagefile.sys in the system drive, and its size can be changed in Advanced system settings.
Common misconceptions
- Virtual memory is not "fake RAM" that makes a PC faster.
- Disabling the page file does not help performance and can cause crashes.
- Swap use is not itself a fault; only constant heavy swapping signals a problem.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.