Sunday, March 21, 2010

memory-usage-free

There is simple command to check for the overall usage of memory including physical memory and swap memory.

What you is just type free and it will shows you the information of the memory usage. for example:



total used free shared buffers cached
Mem: 16442272 16355460 86812 0 129600 10120444
-/+ buffers/cache: 6105416 10336856
Swap: 10223608 263608 9960000



The value shows at the first line of total column, is the total physical memory I have in kilobytes. I have 16GB ram, the results (16442272kb) shown above is approximate in kb. So the system have already used almost all the physically memory, which just left about 84M as free memory.

Out of 15.6G from 5.8G that stored in the system, is actually used. And it still left 9.8G in cache. I have total 10G of swap , and it uses 9.4GM and remain 9.4G unused.

The memory usage seems high but still consider healthy. I have loaded a lots of applications and uses some minor disc space for swap, but everything still running smooth without any lags.

Free have few options, if you feel that memory result shows in kb is not detail enough, you can have more accurate measurement in bytes. You can passes -b for bytes, or less details -m for Megabytes, -g for gigabytes.

free -b



You can ask free to display results in every 5 seconds, in order to track the increases/decreases on memory usage.

free -s 5

SHOW ENGINE INNODB STATUS

  The SHOW ENGINE INNODB STATUS command in MySQL provides detailed information about the internal state of the InnoDB storage engine. This ...