[CentOS] Memory leak - how to investigate

Mon Feb 3 19:44:12 UTC 2014
Kwan Lowe <kwan.lowe at gmail.com>

On Mon, Feb 3, 2014 at 8:43 AM, Jussi Hirvi <listmember at greenspot.fi> wrote:

> My web & name server runs out of memory from time to time, to the point
> where it's completely unresponsive to anything. At that point reset is
> the only alternative. (Or, as this is a virtual guest, I just say "virsh
> destroy").
> But why this happens - I would like to know.

Sever things could be occurring. The first thing I notice is that you have
many httpd processes running. This can be useful if you have many
simultaneous hits. If you don't, you can tune the number of processes down
(search on MAX_CHILD in the httpd.conf).  Don't quote me on this, but you
can lower the number of simultaneous processes and reduce the number of
requests that each processes before exiting. Though much of the memory is
shared, a lot isn't, so reducing the process count helps improve the memory
situation. Cycling them more rapidly can help clean up any that have memory

> The host in question is a KVM guest, and runs CentOS 6.4.

>  From "top" (situation now):
> Mem:   1361564k total,  1264324k used,    97240k free,     8428k buffers
> Swap:  3014648k total,    64852k used,  2949796k free,   358676k cached
That doesn't look like a lot of memory.. Possible to add another .5G or so?