Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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:

http://serverfault.com/questions/23433/in-linux-what-is-the-difference-between-buffers-and-cache-reported-by-the-fr

Any others I should be looking at?

share|improve this question
add comment

2 Answers 2

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
3  
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
1  
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
add comment

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
add comment

Your Answer

 
discard

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.