[Zope-dev] debugging memory leaks

Seb Bacon seb at jamkit.com
Mon Oct 27 14:36:58 EST 2003


Tim Peters wrote:
<snip useful info about new-style classes>

> Debugging memory leaks can be hard, in any language.  

No kidding.  I thought when I identified the suspect class two days ago 
I was nearly there ;-)

> Another place to look
> for ideas is in the top-level test.py from a current Zope HEAD checkout (or
> 2.7 branch, or Zope3). 

OK, will do.

> 2. "Reference cycles".  Big topic <wink>.

Seeing as the suspect leaker contains code like:

  other = Foo()
  other.reciprocal = self
  self.reciprocal = other

I fear the worst ;-)

...but my (naive?) reading of the documentation was that reference 
cycles are cleaned out by the garbage collector, *unless* they define a 
__del__ (which is not the case here).  How am I wrong?

Thanks,

seb








More information about the Zope-Dev mailing list