[Metakit] Hash view questions

Jean-Claude Wippler jcw at equi4.com
Wed Feb 1 18:55:13 CET 2006


zooko at zooko.com wrote:

> Is there anyone who will look into the memory leak that I reported  
> [1]?

I looked at the example, and couldn't see a problem with.  I'm pretty  
confident that memory leaks have been beaten out of the C++ core by  
now (though I could of course well be mistaken).

Your sample code does show increasing memory use on my setup as  
well.  Is there a way to find out what the content or at least sizes/ 
counts of the leaked memory areas is in Python?

> I would be willing to investigate it myself, but I hope that  
> someone with
> previous experience will give me some tips to get started.  Has the  
> Metakit C++
> version been tested for leaks of this kind already?

Yes, in all three variants: regular, MFC-based, and STL-based.  The C+ 
+ regression tests will detect this in debug mode.

> Are the Python wrappers still generated by SCXX?

Yes, see the source code.  So most inc/decrefs "should" be automatic.

> I guess the next step is to rewrite the leak test in C++ and see if  
> the problem
> lies in the C++ core or not.

I wouldn't start there.  Better perhaps find which Python call might  
be the leaky one (do twice as many inserts and reset view size to  
zero halfway, for example).  Then see if inserting more data affects  
the leak size, or if the call form insert(tuple) vs. insert(kwargs)  
makes a difference.

I'd be interested to hear what the problem is, of course.  I don't  
see anything jump out, looking at PyView_insert in PyView.cpp so far.

-jcw




More information about the Metakit mailing list