During the installation of many modern Linux distributions, the hard drive (HDD) is automatically partitioned with the necessary file system (which include the Swap partition) to make the installation process simple as possible. After installation you can check your swap partition by entering the ‘free’ command in the terminal:
But there are some situations that necessitate you manually create a swap partition during installation.
Then what is the Swap partition?
The swap partition (or memory) is like a backup memory that is used by your computer’s RAM (read access memory) when it runs out of RAM space. A Linux PC without swap will freeze or refuse to launch new applications/processes unless a reboot of the system is carried out.
The swap partition can also help in moving some items (that are rarely used) from the RAM to the HDD in order to create enough room in the RAM for more important processes/applications. It is usually recommended that the size of the swap memory be equal or twice the size of the RAM when you have to manually create partitions on your HDD.
But computers have developed so much and become faster with enough memory (RAM) to run very complex processes/applications. And as a result the swap is mainly used to store running applications states when the PC goes into hibernation. And later used for a quick reboot of the system to exactly the state it was in prior.
Thought the swap memory can be helpful when it comes to memory related performance problems, it is best to just increase (upgrade) the RAM to a higher memory. Instead of increasing the swap memory.
Another smart thing to do would be to manage memory leakages using system monitoring tools to ease the memory strain on the RAM.