2 Implementing Swap Spaces

Swap spaces are a way by which the operating system manages resources in the system to ensure efficient performance.

Oracle Linux uses swap space if your system does not have enough physical memory for ongoing processes. When available memory is low, the operating system writes inactive pages to swap space on the disk, and thus free up physical memory.

However, swap space is not an effective solution to memory shortage. Swap space is located on disk drives, which have much slower access times than physical memory. Writing to swap space effectively degrades system performance. If your system often resorts to swapping, you should add more physical memory, not more swap space.

Swap space can be either in a swap file or on a separate swap partition. A dedicated swap partition is faster, but changing the size of a swap file is easier. If you know how much swap space your system requires, configure a swap partition. Otherwise, start with a swap file and create a swap partition later when you know what your system requires.