Operating Systems

Virtual Memory

Definition

Virtual memory is a memory management technique that provides an "idealized abstraction of the storage resources that are actually available on a given machine" which "creates the illusion to users of a very large (main) memory".

Why It Matters

Virtual memory allows a computer to run larger programs or more programs at once than it could if it were limited to its physical RAM. It does this by temporarily transferring data from RAM to disk storage.

Contextual Example

If you have 8GB of RAM but are trying to run applications that need 10GB, the OS will use virtual memory. It will move the least-used 2GB of data from RAM to a "swap file" or "page file" on your hard drive. When that data is needed again, it's swapped back into RAM.

Common Misunderstandings

  • Using virtual memory is much slower than using physical RAM, as disk access is thousands of times slower. Excessive use of virtual memory leads to a condition called "thrashing," where the system spends all its time swapping data and becomes very slow.
  • It also provides memory isolation, so one process cannot access the memory of another process.

Related Terms

Last Updated: December 17, 2025