fixed memory leaks

Matthias Andree matthias.andree at gmx.de
Sun Mar 30 14:56:03 CEST 2003


David Relson <relson at osagesoftware.com> writes:

> Dan Deward had reported a couple of memory leaks.  While investigating
> them, I decided that bogofilter should release _everything_ it used.  I
> have a debug version of the xmalloc* routines that tracks current,
> maximum, and total bytes of memory usage as well as counts for mallocs
> (including calloc and realloc) and frees and reports the results.  Since
> I was working on malloc/free errors, I decided that the job would be
> done when all tests reported "cur_malloc = 0".  That result was achieved.
>
> Is there a noticeable difference?  Not really.  If I recall, registering
> large mailboxes before my fixes might show a maximum usage of several
> MB.  After fixes, the max was under 1 MB.  There was a time several
> months back when "top" indicated a memory size of 300MB+ for a
> registration run, but I've never reproduced that.

Top also includes mapped areas, which happens on current system for
virtually any file the system libraries and Berkeley DB open, so it
looks as though the whole DB file sizes PLUS BDB cache were used as
memory.

> If you're interested in the usage tracking code, I can post it.

No thanks, I have valgrind and memprof. :-)

-- 
Matthias Andree




More information about the bogofilter-dev mailing list