Term:Virtual Memory

« Back to Glossary Index

Virtual memory is simply the operating system using some amount of disk space as if it were real  RAM, or memory.

Exactly how virtual memory is implemented is complex, but as an over-simplification:

  • You run programs that need memory. The operating system takes care of tracking which program is using what portions of memory, and allocating each program the amount of memory it needs.
  • Those programs will need more memory as they do their jobs. Opening a large document may cause your word processor to request additional memory from the operating system in order to hold the document.
  • If there isn’t enough RAM available to satisfy a request, the operating system may decide that another program’s needs are less “important.” Some of that program’s memory will be freed, first by writing the contents to disk (the memory is “swapped out”), and then allocated to the program making the request.
  • Later, when the program whose memory was swapped out needs it back, that memory can be “swapped in” by reading it back from disk. This might cause memory from another program to be swapped out to disk to make room.

Remember that the operating system itself is just a program; it needs memory too. It can allocate memory to itself, and its memory may get swapped out to disk as other needs arise.

(This is an excerpt from the lengthier Ask Leo! article: What is Virtual Memory?)

Virtual Memory (Wikipedia)
Virtual memory combines active RAM and inactive memory on DASD to form a large range of contiguous addresses.

In computing, virtual memory, or virtual storage 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".

The computer's operating system, using a combination of hardware and software, maps memory addresses used by a program, called virtual addresses, into physical addresses in computer memory. Main storage, as seen by a process or task, appears as a contiguous address space or collection of contiguous segments. The operating system manages virtual address spaces and the assignment of real memory to virtual memory. Address translation hardware in the CPU, often referred to as a memory management unit (MMU), automatically translates virtual addresses to physical addresses. Software within the operating system may extend these capabilities to provide a virtual address space that can exceed the capacity of real memory and thus reference more memory than is physically present in the computer.

The primary benefits of virtual memory include freeing applications from having to manage a shared memory space, ability to share memory used by libraries between processes, increased security due to memory isolation, and being able to conceptually use more memory than might be physically available, using the technique of paging or segmentation.

« Back to Glossary Index