VirtualMemory refers to the concept that the address space of a program does directly not correspond to the physical memory layout. The process address space may therefor have holes and rarely covers all of physical memory. It is the OperatingSystem's responsibility to map process address space to physical memory. This has a number of benefits:

  • Processes are completely separated from each other. They each live in their own address spaces representing a closed universe to which the effect of their actions in memory is confined. This vastly improves security and stability.
  • A process has a consistent view of memory regardless of how the OperatingSystem actually maps it to real memory.
  • It is possible to allocate more memory to a process than the machine has RAM, and, through the PageFault mechanism, swap pages in and out of physical memory on demand.
  • The PageFault mechanism also allows to use memory access as a metaphor for other operations without necessitating longwinded copy operations:

    • mmap(2) allows to treat memory as a mirror image of a file on disk, obviating the need for explicit I/O calls such as lseek(2), read(2) and write(2).
    • The framebuffer of a graphics card can be mapped onto process address space, obviating the need for explicitly paging in and out the proper graphics memory segments.

See also: