system. It is always a good practice to monitor swap space usage in Linux to ensure that your system operates
relative to its memory demands.
Therefore in this article we are going to look at ways to monitor swap space usage in a Linux systems.
#swaponall
If you want to view a summary of swap space usage by device, use the summary option as follows.
# swapon --summary
Filename TypeSizeUsedPriority
/dev/sda10partition8282108 01
Use help option to view help information or open the manpage for more usage options.
# cat /proc/swaps
Filename TypeSizeUsedPriority
/dev/sda10partition8282108 01
From the output above, you can see that the last line provides information about the system swap space. For more
usage and examples of free command can be found at: 10 free Command to Check Memory Usage in Linux.
#top
#atop
To know more about how to install and use atop command in Linux, read this article: Monitor Logging Activity of
Linux System Processes
#htop
For more information regarding installation and usage about htop command, read this article: Htop Interactive
Linux Process Monitoring
#glances
For more information regarding installation and usage about glances command, read this article: Glances An
Advanced Real Time Linux System Monitoring Tool
#vmstat
You need to take note of the following in the swap field from the output of this command.