While initial views of the Linux memory statistics may suggest the system has run out of memory, the reality is that Linux uses any free RAM available as a disk cache and buffering for network services. By caching files from disk, this provides a boost to performance of the overall server since accessing a file from memory is significantly faster than from a hard drive. When applications require more memory, the Linux kernel automatically frees the memory allocated to the cache and provides it to the applications.

Here’s an example memory output:

CT-0000-bash-4.1# free -m
             total       used       free     shared    buffers     cached
Mem:          2048       1871        176          0          0        842
-/+ buffers/cache:       1029       1018
Swap:            0          0          0

This system has a total of 2048MB and has listed and a total of 1871MB used. If you look at the top line only it would appear that the system only has 176MB free! Don’t panic though, the actual amount of memory available to your applications is the combination of the free memory (176MB) and the cached memory (842MB). So, for this particular server there’s actually 1018MB of memory available for your applications.

Was this article helpful?

Related Articles