What is Swap Space?
It’s an area on disk that temporarily holds a process memory image. When physical
memory demand is sufficiently low, process memory images are brought back into
physical memory from the swap area on disk. Having sufficient swap space enables the
system to keep some physical memory free at all times. This type of memory
management is often referred to as virtual memory and allows the total number of
processes to exceed physical memory. Virtual memory enables the execution of a
process within physical memory only as needed. Swap space can be a dedicated swap
partition (recommended), a swap file, or a combination of swap partitions and swap
files. Space allocation criteria should be equal to 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. Simply if, Memory in Ram is 512MB then Swap Space will
be
swap, while the other with 3 GB of physical RAM would have 5 GB of swap.
Creating a large swap space partition can be especially helpful if you plan to
upgrade your RAM at a later time. For systems with really large amounts of
RAM (more than 32 GB) you can likely get away with a smaller swap partition
(around 1x, or less, of physical RAM).
Important
File systems and LVM2 volumes assigned as swap space cannot be in use when being
modified. For example, no system processes can be assigned the swap space, as well as
no amount of swap should be allocated and used by the kernel. Use the free and cat
/proc/swaps commands to verify how much and where swap is in use.
The best way to achieve swap space modifications is to boot your system in rescue
mode, and then follow the instructions (for each scenario) in the remainder of this
chapter. Refer to the Red Hat Enterprise Linux Installation Guide for instructions on
booting into rescue mode. When prompted to mount the file system, select Skip.
memory demand is sufficiently low, process memory images are brought back into
physical memory from the swap area on disk. Having sufficient swap space enables the
system to keep some physical memory free at all times. This type of memory
management is often referred to as virtual memory and allows the total number of
processes to exceed physical memory. Virtual memory enables the execution of a
process within physical memory only as needed. Swap space can be a dedicated swap
partition (recommended), a swap file, or a combination of swap partitions and swap
files. Space allocation criteria should be equal to 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. Simply if, Memory in Ram is 512MB then Swap Space will
be
- 512*2 = 1024MB
- if M = Amount of RAM in GB, and S = Amount of swap in GB, then
- If M <>
- S = M *2
- Else
- S = M + 2
swap, while the other with 3 GB of physical RAM would have 5 GB of swap.
Creating a large swap space partition can be especially helpful if you plan to
upgrade your RAM at a later time. For systems with really large amounts of
RAM (more than 32 GB) you can likely get away with a smaller swap partition
(around 1x, or less, of physical RAM).
Important
File systems and LVM2 volumes assigned as swap space cannot be in use when being
modified. For example, no system processes can be assigned the swap space, as well as
no amount of swap should be allocated and used by the kernel. Use the free and cat
/proc/swaps commands to verify how much and where swap is in use.
The best way to achieve swap space modifications is to boot your system in rescue
mode, and then follow the instructions (for each scenario) in the remainder of this
chapter. Refer to the Red Hat Enterprise Linux Installation Guide for instructions on
booting into rescue mode. When prompted to mount the file system, select Skip.
Comments
Post a Comment