Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I have a VPS running CentOS with some PHP sites. It's been running fine for weeks.

Recently it has become slower and slower (both website usage and when logged in via SSH). I have determined that it consistently uses more and more memory until it maxes out, then I have to reboot it, the memory usage goes back down, but then constantly climbs again.

What could be causing this and how can I analyze/solve it?

alt text

here is my top:

alt text

share|improve this question

While running top, you can press M (capital m) to sort by memory usage. You can watch for what is using the most memory there.

If Apache is the problem, you can work around memory leaks by setting or lowering the MaxRequestsPerChild parameter. This will kill off an Apache worker process after it has processed the specified number of requests.

share|improve this answer

Any program could be leaking memory; the best thing to do is to run sysstat (sar) at regular intervals via cron to capture process information periodically, and then look at the memory consumption of all your processes over time and see which one(s) are growing (or if there are more processes over time).

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.