• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to monitor swap space usage in Linux

{{postValue.id}}

To monitor swap space usage in Linux

In this article we will explain how to monitor swap space usage in Linux. Swap space holds the virtual memory of the system, which is located on the hard drive of the system.

When the physical memory(RAM) available is fully utilized then the dedicated memory called Swap space from the hard drive is allocated to run the applications of the system.

In Linux machine Swap space can be a dedicated Swap partition, which is created during the installation of the Operating System. The Swap partition size allocation is depends on the available RAM memory size.

Eg: For 2GB RAM memory 4GB of Swap partition is recommended.

To check swap space by following Commands

1. Use Swapon command to monitor swap space status

To view summary of swap space usage " --summary" or " &ndash s" option is used to view summary of swap space usage, both the options performs the same process.

[root@linuxhelp~]# swapon &ndash summary

Output:

S1

2. Using /proc/swaps command to monitor swap space status

Proc is referred to as process information pseudo file system

[root@linuxhelp~]# cat /proc/swaps

Output:
S2

3. Using ‘ free’ Command to monitor swap space status

Using -h option in free command is used to display the amount of free and used system memory.

[root@linuxhelp~]# free -h

Output:

S3

4. Using top Command to monitor swap space status

It shows the processor activity of Linux in real time.

[root@linuxhelp~]# top

Output:

S4

5. Using atop Command to monitor swap space status

It is used to monitor reports activities of various processes and displays used and available memory space.

[root@linuxhelp~]# atop

Output:

S5

6. Using htop Command to monitor swap space status

It is used to view the information about memory usage and the processes in interactive mode

[root@linuxhelp~]# htop

Output:

S6

7. Using the Glances Command to monitor swap space status

Glances command displays the information about running processes like storage space, cpu load, memory usage etc.

[root@linuxhelp~]# glances

Output:

S7

8. Using the vmstat Command to monitor swap space status

Vmstat command will displays the information about virtual memory statistics.

[root@linuxhelp~]# vmstat

Output:

S8


so- memory swapped to disk
si - memory swapped from disk

Points to remember

Some Linux machine don’ t have htop, atop, glances and vmstat packages by default . You can install these packages by using yum install.

Example:

[root@linuxhelp~]#yum install htop

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to increase swap on linux

A

Please refer the link to increase your swap space https://www.linuxhelp.com/how-to-increase-swap-memory-in-centos-7/

Q

How to delete a swap partition in linux

A

Swap partition can be removed by simply using the following command. swapoff -a

Q

Do I really need a swap partition?

A

You will no longer require a swap partition until you are going to use the full memory of your physical RAM, if the RAM memory is almost filled it should go for swap space and take some memor

Q

How can I determine about what size should I give while creating the swap partition

A

Better try to give the Size, which double your physical RAM to get better performance

Q

For dual boot setup (Ubuntu & Centos) does I require to create 2 swap partition or one is enough?

A

There is One Swap partition is enough both linux distros, you don’t need to waste some GB for second swap partition

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Lucas ?
Various options in Top command

Am using Top command only to view the load average, what are the various options in Top command..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.