:: What is swap in linux
Swap 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.

 
:: How to create swap file in Linux
+ Create file (1GB) for add swap

+ Make swap file

+ Change owner and permission

+ Enable swap file

+ Checking

+ configure /etc/fstab to save configuration permanently

 
:: Link
+ Google
+ Cyberciti