Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a Linux server for which Cacti's memory usage graph reports decreasing cache size until the server eventually runs out of memory. Free memory remains low throughout, which is normal for Linux. I would expect cache size to remain roughly constant over time, and I'm trying to think of what might possibly be going on with this.

I assume that a kernel memory leak is not a likely issue.

I also saw this, which says that saving to a tmpfs filesystem is a possibility:

Any others I should be looking at?

share|improve this question
up vote 2 down vote accepted

A reduction in cache, assuming your free memory and buffers stays the same, just means that some process on the system was judged to need it more (in technical terms, the "working set" of memory pages for the processes running on the system grew larger, so the kernel needs to keep more pages in main memory).

share|improve this answer
Actually memory used by tmpfs filesystems is usually counted in the cached value, so deleting things from tmpfs filesystems, not adding them, will make the amount of cache free shows drop (and it will initially be counted at free rather then used, until something else grabs the memory). – David Spillett Nov 25 '09 at 16:05
Holy moley, you're right. Create a big file on a tmpfs and cache usage shoots up, delete it again and it goes down. Thanks for the correction, answer updated. – womble Nov 25 '09 at 16:17

What Womble said is correct in how cache is managed but that doesn't rule out a memory leak. So keep an eye on what processes seem to be creeping in it's memory usage. Once you identify the suspect processes you will have to determine if this is normal behaviour, in which case it may be tunable behaviour, or a memory leak.

Services like MySQL have a tunable amount of ram that they will use for caching. It could be that this is just set to high for your system making MySQL caching too aggressive. Lowering this may result in lower performance if this is the case you'll want to consider getting more ram in the server.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.