Swap Space


Swap Space, in Linux, is a Virtual Memory mechanism.[1]

If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the Swap Space.

Swap Space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM.

Swap Space is located on hard drives, which have a slower access time than physical memory.

Swap Space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB.

Linux and Swap Space#

Page Fault is a type of exception raised by computer hardware when a running program accesses a memory page that is not currently mapped by the memory management unit (MMU) into the Virtual Memory address space of a process. The processor's MMU detects the page fault, while the exception handling software that handles page faults is generally a part of the Operating System kernel. When handling a page fault, the Operating System generally tries to make the required page accessible, perhaps retrieving the page from Swap Space, at the location in physical memory, or terminates the program in case of an illegal memory access.

More Information#

There might be more information for this subject on one of the following: