Linux Swap Space

Linux Swap Space

Linux swap space is normally configured either on a dedicated partition or a logical volume. Such space is used to extend the amount of effective RAM on a system, as virtual memory for currently running programs. But you can’t just buy extra RAM and eliminate swap space.

Linux moves infrequently used programs and data to swap space even if you have gigabytes of RAM. As such, RAID arrays of swap space make little sense, as why would anyone back up fragments of data from RAM? The way Red Hat assigns default swap space is based on the amount of RAM on a system and the space available in local hard drives. For systems of up to 2GB, the default swap space size is twice the amount of installed RAM. Above 2GB, it’s the
amount of RAM + 2GB. But those are not “hard and fast” rules. Workstations with several GB of RAM frequently use very little swap space.

On my home server, I have 8GB of RAM and 4GB of swap space. That swap space is rarely used, but it may be
used more frequently on systems that aren’t rebooted for months at a time or have heavy demand from certain services. In any case, the default installation configures swap space not in a dedicated partition, but as a logical volume