Mailing List Archive

Help tracing qmail-rspawn memory leak
Hello Everyone,

I've recently encountered a memory leak with qmail-rspawn in one of my
setups. I've managed to setup a test environment which I can duplicate the
memory leak. But I can't seem to pinpoint what is actually causing the
leak. So I don't know what to patch/fix.

Seems that qmail-rspawn grows by 4 to 14 bytes when processing incoming mail
and delivering it remotely. After a while, this qmail-rspawn process grows
quickly to over 100MB.

At first, I thought it might be because of some patches/mods I had applied
to qmail. So I downloaded a fresh package from qmail.org and did a fresh
source compilation and the problem is still there. I did add some debug
logging to qmail-rspawn, qmail-send, timeoutconn and qmail-remote to see if
I could catch anything strange. Timeoutconn() seems to exit at the same
place all the time. Qmail-rspawn child/parent pids seem to consistently
create and terminate themselves.

In terms of the leak itself. Here are some stats from one test:
1. I start up qmail and the qmail-rspawn process is 336 bytes
2. I send a single email (internal but not local to the server) and
qmail-rspawn jumps to 360 bytes.
3. I launch a script that sends 50 emails and it jumps to 364 bytes
4. repeat 3 and it jumps to 368
5. again but this time to 376 bytes.

So looking at my systems via /proc/<pid>/maps, I noticed that one system
(which doesn't have a leak) is using ld/libc v2.3.3. Both the problem
system and my test system are running libc v2.3.6 (on Fedora Core 4).

Other than this, I'm not sure where to go from here. Anybody have any ideas
or can anyone recommend debug tools that would be useful for this and easy
to use for qmail debugging? I've been tinkering with a few tools but
they've been a bit of a nightmare to try and get working within rspawn.

Thanks in advance.
Yves
Re: Help tracing qmail-rspawn memory leak [ In reply to ]
On Thursday 16 November 2006 16:56, Yves wrote:
> I've recently encountered a memory leak with qmail-rspawn in one of
> my setups...
...
> So looking at my systems via /proc/<pid>/maps, I noticed that one
> system (which doesn't have a leak) is using ld/libc v2.3.3.  Both
> the problem system and my test system are running libc v2.3.6 (on
> Fedora Core 4).

I think you've identified the leak right there: It looks like the
problem is occurring within libc in FC4. I'm not aware of any memory
leaks in qmail[-remote] itself - and if there were one, you'd expect
it to occur in both setups, not just the libc v2.3.6 one.

cheers,

Andrew.
--
======================================================================
Network Design & Build http://www.nwdb.co.uk/

* Custom email solutions * Systems Administration * Networking
======================================================================