Skip to Main Content

Checking Swap Space Size and Usage on CentOS

You can check the size and current usage of CentOS swap space by running:

$ grep SwapTotal /proc/meminfo

You can check current swap activity using:

$ vmstat 3 100
procs --------memory---------- --swap-- --io-- --system-- --cpu---
r b   swpd free buff cache     si so bi bo in cs us sy id wa st
0 0   1272 61748 227044 2786452 0 0   1 3   7 7 0 0 100 0 0
0 0   1272 61764 227044 2786452 0 0   0 19 18 19 0 0 100 0 0
0 0   1272 61796 227044 2786452 0 0   0 0 21 25 0 0 100 0 0
0 0   1272 61796 227044 2786452 0 0   0 12 29 29 0 0 100 0 0

The swpd column shows total swap usage. The si and so columns show the amount of memory swapped in and swapped out. Swapping should be relatively rare, so the si and so columns should usually be zero. If they are consistently non-zero, your system needs more RAM.

 

Most RecentRSS

ArchiveRSS

March 2016 (1)
January 2016 (1)
September 2015 (1)
May 2015 (1)
April 2015 (1)
March 2015 (1)
February 2015 (2)
January 2015 (5)
September 2014 (2)
August 2014 (4)
July 2014 (1)
March 2014 (1)
November 2013 (3)
September 2013 (3)
July 2013 (6)
June 2013 (1)
May 2013 (1)
March 2013 (2)
February 2013 (3)
January 2013 (4)