Check Memory Info

Run the command below to check memory info.

# cat /proc/meminfo

Output sample:

root@cpanel [~]# cat /proc/meminfo
MemTotal:         524288 kB
MemFree:           36008 kB
Cached:            43764 kB
Buffers:               0 kB
Active:           399572 kB
Inactive:          61432 kB
Active(anon):     390872 kB
Inactive(anon):    26368 kB
Active(file):       8700 kB
Inactive(file):    35064 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:        417240 kB
Shmem:              2652 kB
Slab:              27260 kB
SReclaimable:      15132 kB
SUnreclaim:        12128 kB

In Linux, ram is used to cache files and programs. This cache setting will speed up performance since it’s already loaded into ram. Cache will typically consume a lot of ram making the user to believe they are out of ram but in actuality, they still have ram. Cache rams will adjust if the OS needs more ram to run certain programs. To see how much ram is available, run the following command:

# free -m

Here’s the output:

[root@server ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         48152      40085       8066          0       1256      30635
-/+ buffers/cache:       8193      39958
Swap:        49999         47      49952
[root@server ~]#

In the example above, there is 48GB or ram total. 40GB is used according to the “Mem” line. In actuality, most of it is setup to cache programs and files. The real amount of available ram is on line 2 (buffers/cache) where it says “free”. For this system, there is about 39GB of free memory.

admin has written 39 articles