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

How to Reset the Directory Manager Password on RHEL 7 / CentOS 7
How to Reset the Directory Manager Password on RHEL 7 / CentOS 7

It is best practice to remember passwords, but because too many passwords, sometimes we forget. We are not encouraged to write the password on any paper or share the password...

How to Find Big Files Size on Linux RHEL/CentOS
How to Find Big Files Size on Linux RHEL/CentOS

As the linux administrator, sometimes we have to identify which files are most take much space in the linux server resulting in low free space. Low disk space can also...

Why Linux users should worry about malware and what they can do about it
Why Linux users should worry about malware and what they can do about it

Don’t drop your guard just because you’re running Linux. Preventing the spread of malware and/or dealing with the consequences of infection are a fact of life when using computers. If...

How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7
How to Reset Forgotten Root Password on Linux RHEL 7 / CentOS 7

This short howto will explain the steps to reset a lost root password or to reset a forgotten root password on Linux RHEL 7 or CentOS 7. Basically, we will...

How to Update CentOS or Upgrade CentOS to the Latest Version
How to Update CentOS or Upgrade CentOS to the Latest Version

Recently, the latest version of CentOS 7.3 was released. All users of CentOS 7.0, 7.1 and 7.2 can upgrade their system to the most recent. This quick guide will explain...

How to Change your WordPress Username, Nickname and Display Name in MySQL
How to Change your WordPress Username, Nickname and Display Name in MySQL

After you create an account log in WordPress, you may want to change your WordPress username, as appropriate or due to security reason. However, you can not do this from...

How to Enable SSH Root Login on Ubuntu 16.04
How to Enable SSH Root Login on Ubuntu 16.04

As what we wrote in the previous article on how to allow SSH root on Ubuntu 14.04, after installing a fresh new copy of Ubuntu 16.04 LTS, we find that...

How to Change UUID of Linux Partition on CentOS 7
How to Change UUID of Linux Partition on CentOS 7

UUID (Universally Unique IDentifier) should be unique and it is used to identify storage devices on a linux system. If you cloned a virtual machine from vCenter, the metadata containing...

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *