Thursday, November 13, 2008

How to check Memory Utilization in Linux

There're a lot commands to check the memory utilization in linux. However, do we really understand the output of each command? Either using free, top and others command, we'll see the result showed that the memory is almost fully utilized.

Actualy memory is not used by application, but it is used for disk caching. If memory is not fully utilized by kernel than it is wasted, by keeping data in cache when an application needs data again it can be provided faster.

If you want to see the memory from the perspective of application you should look at +- buffers/cache line, the free column of this line shows you the memory that can be used for applications.

In the case below my server using 1.1GB of memory.
# free -m
--------------------total --used----free---shared---buffers---cached
Mem: -------------3990--3583----406--------0-------135-----2289
-/+ buffers/cache:------1158----2832
Swap:--------------2015-----0----2015

No comments: