How to Check Memory Usage on Linux VPS Server



There are several ways on how to check the memory usage on linux virtual Private Server (VPS). This steps has been tested on linux CentOS 6.2 server and may workings on other linux server as well.

1. Check memory usage using “/proc/meminfo” command:

[root@centos62 ~]# cat /proc/meminfo

Output :

MemTotal:        1030888 kB
MemFree:          710372 kB
Buffers:           36444 kB
Cached:           191484 kB
SwapCached:            0 kB
Active:           180552 kB
Inactive:         104976 kB
Active(anon):      58048 kB
Inactive(anon):     2124 kB
Active(file):     122504 kB
Inactive(file):   102852 kB
Unevictable:           0 kB
Mlocked:               0 kB
HighTotal:        141256 kB
HighFree:            280 kB
LowTotal:         889632 kB
LowFree:          710092 kB
SwapTotal:       2064376 kB
SwapFree:        2064376 kB
Dirty:              1388 kB
Writeback:             0 kB
AnonPages:         57628 kB
Mapped:            16512 kB
Shmem:              2564 kB
Slab:              21372 kB
SReclaimable:      15292 kB
SUnreclaim:         6080 kB
KernelStack:        1192 kB
PageTables:         1712 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2579820 kB
Committed_AS:     158252 kB
VmallocTotal:     122880 kB
VmallocUsed:        4264 kB
VmallocChunk:     111800 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       10232 kB
DirectMap2M:      897024 kB

2. Check memory usage using “free -m” command :

[root@centos62 ~]# free -m

Output :

             total       used       free     shared    buffers     cached
Mem:          1006        317        689          0         36        190
-/+ buffers/cache:         90        916
Swap:         2015          0       2015
[root@centos62 ~]#

3. Check memory usage using “top” command :

[root@centos62 ~]# top

Output :

Tasks:  84 total,   1 running,  83 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.5%us,  2.4%sy,  0.0%ni, 96.0%id,  0.8%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   1030888k total,   324996k used,   705892k free,    37324k buffers
Swap:  2064376k total,        0k used,  2064376k free,   194916k cached

4. Check memory usage using “vmstat” command :

[root@centos62 ~]# vmstat

Output :

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      0 701072  38236 198804    0    0    18    23   88   97  1  3 96  1  0

As always if you need any help you can reach us on twitter @ehowstuff or drop us a comment below. Jumping through archives page to read more articles..

Related Articles

One thought on “How to Check Memory Usage on Linux VPS Server

Leave a Reply