For those not following the Python list. ----- Forwarded message from Christian Heimes <[EMAIL PROTECTED]> -----
From: Christian Heimes <[EMAIL PROTECTED]> To: Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED], "rupert.thurner" <[EMAIL PROTECTED]> Subject: Re: finding memory leak in edgewall trac 0.11 Date: Sat, 19 Jan 2008 22:31:38 +0100 User-Agent: Thunderbird 2.0.0.6 (X11/20071022) Jeroen Ruigrok van der Werven wrote: > Hi Christian, > > -On [20080119 16:16], Christian Heimes ([EMAIL PROTECTED]) wrote: >> I forgot one important point in my reply. The GC module contains some >> useful methods for debugging. Check gc.garbage. It should be empty. > > Yeah, we're messing around with that stuff as well as many other ways of > trying to track issues, but it can really be looking for a needle in a > haystack to be honest. > There's so much output that, I guess, make sense only when you're semi-deep > into the Python internals to even make heads or tails out of it. =\ > And even third-party code is not helping much to reduce the clutter and > provide insight. Under normal circumstances gc.garbage should be an empty list. In general it's a bad sign if gc.garbage contains lots of objects. I found several potential leaks in trac: $ find -name \*.py | xargs grep __del__ ./trac/versioncontrol/svn_fs.py: def __del__(self): ./trac/versioncontrol/svn_fs.py: def __del__(self): ./trac/db/pool.py: def __del__(self): $ find -name \*.py | xargs grep frame ./trac/web/main.py: [...] ./trac/core.py: frame = sys._getframe(1) ./trac/core.py: locals_ = frame.f_locals I recommend that you either replace __del__ with a weak reference callback or to remove it. Referencing a frame, traceback or f_locals is going to leak, too. You *must* explicitly del every frame and locals variable. Christian ----- End forwarded message ----- -- Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in-nomine.org/ | http://www.rangaku.org/ Time will tell everything - given time... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en -~----------~----~----~----~------~----~------~--~---
