Finding out how much free memory a Linux system has available can be tricky. Linux uses all of the RAM it can because unused RAM is wasted RAM. RAM that is not needed for applications is used for buffers and cache. The command in Linux for getting memory information is called free, which is always installed by default. To view the results in megabytes, use the -m switch.

free -m

The result will look like this:

             total       used       free     shared    buffers     cached
Mem:          1010        857        152          0        205        367
-/+ buffers/cache:        284        726
Swap:         1027        149        877
tom@tomstation:~$ 

Looking at the “Mem” line it would look like there is only 152 MB of free RAM available for applications. The “-/+ buffers/cache” line subtracts the buffers and cache from the used memory. This line shows that there is plenty of RAM available.

You can just view the line with the buffers and cache subtracted with grep.

free -m | grep cache

That will give you the best idea of your system’s RAM usage.


Related Posts