[Zope-dev] debugging memory leaks

Seb Bacon seb at jamkit.com
Mon Oct 27 06:01:16 EST 2003


I've got a fairly major memory leak in my application.  I've followed 
the thread from August including Shane's suggestions about using a debug 
build of Python to inspect object references and the rest [1]

I know from the refcounts in Zope that items of class Foo are definitely 
leaking, yet when I do a sys.getobjects(0, Foo) I get nothing back. 
Navigating all 100000-ish references one by one seems a bit daunting. 
So I'm not sure where to go from here.

Shane, you mentioned you had put together some useful functions for 
exploring this debug information - could you share them?  Or were you 
just refering to the remote console you supplied earlier?

Also, what kinds of Python code can cause memory leaks?  I'm not really 
sure what I should be looking for.  The only thing I can think of is 
hanging file descriptors, as circular references should be picked up by 
the gc anyway.

Seb

[1] http://mail.zope.org/pipermail/zope-dev/2003-August/020358.html




More information about the Zope-Dev mailing list