[ale] C++ memory leak

Danny Cox DCox at icc.net
Wed Oct 11 09:45:09 EDT 2006


Jim,

On Wed, 2006-10-11 at 08:58 -0400, Jim wrote:
> I have a fairly complex application that uses a number of third party 
> class libraries, all open source.  I've got a slight memory leak.  It 
> seems to grab about a meg a day.  I've attempted to locate the leak 
> using a variety of methods including Electric Fence, setting the log to 
> output almost all steps and including frequent memory checks to see what 
> it is doing when the memory gets incremented.  I pretty much haven't 
> found a thing.  The problem seemed to occur at random.   I converted all 
> of my pointers to boost smart pointers and am fairly sure I'm using them 
> legally to eliminate a missing "delete" somewhere.  

	Have you tried valgrind?  It comes standard with many distros, and can
reliably detect leaks.  It can tell mismatches in C++ between a new
paired with a free, along with a malloc paired with a delete.

<snip>

-- 
Daniel S. Cox
Internet Commerce Corporation





More information about the Ale mailing list