Explain what swap does.

So, does this mean that a SWAP partition is necessary? Absolutely not! A Linux system can perform perfectly well without a SWAP partition. However, there are a few advantages and disadvantages of having one.

Advantages:

  • Provides overflow space when your memory fills up completely
  • Can move rarely-needed items away from your high-speed memory
  • Allows you to hibernate

Disadvantages:

  • Takes up space on your hard drive as SWAP partitions do not resize dynamically
  • Can increase wear and tear to your hard drive
  • Does not necessarily improve performance (see below)

source: makeuseof.com/tag/swap-partition/

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM

The best way to achieve swap space modifications is to boot your system in rescue mode,

A SWAP partition can also help move some items from your memory to your hard drive in order to leave more room in memory for more important items. This implies that items that are rarely ever touched would get moved to the SWAP partition.

centos.org/docs/5/html/5.2/Deployment_Guide/s1-swap-what-is.html