How to Check Swap Space/Memory/Size on Linux VPS Server

Linux uses swap space as a back up to its physical memory with an overflow area. Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the swap space will gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache. All these four commands will show the allocated swap disk or disks, if any and have been tested on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7. Your output should look like the followings :