High RAM usage, but the server is idle

It is common to see, specially in new servers, reports of high RAM usage when the server’s basically idle (no special applications running, no Apache requests, no email sendings, etc.). As time passes, the memory consumption seems to be increasing and it won’t go down. This is true when using, for example: top

The ram usage (80%-90% of total RAM used) is actually normal. The Operating System performs caching directly to the RAM for faster responses. You can use the free -m command to see the real distribution of memory in your system.

ramuse

In the example above, the “cached” column indicates the used RAM for cache (which is a good thing). The total RAM used is 581MB out of 1024MB, as pointed out by the “used” column. Nevertheless, the actual amount of RAM being used is 157 MB — that is the difference between used RAM and cached RAM (which is 424MB).

Cached RAM makes your server go faster. In the case that an application needs more RAM, the cached RAM will be freed, then assigned to the program that needs it. This is a normal behavior that boosts performance, so there’s nothing to worry about.

Linux basically borrows unused memory for disk caching, which makes it look like you are low on memory. It only borrows the ram that applications don’t currently want.

Should you disable disk caching? No! The only reason why you’d want to disable disk caching is because you think it takes memory away from applications, which it doesn’t, so there’s absolutely no reason to disable it.