TwistedElephant: A Memory Debugger for Twisted Applications

Recently, I was trying to figure out why a Twisted application was leaking memory at a disturbingly rapid rate. In the process of investigation, I hacked up some one-off bits of logging within the target application that used Python’s GC module and my di() hack such that I could explore the active object graph within the Twisted process.

Knowing that I would be faced with this problem again, I did a bit of recreational hacking over Memorial Day and created a primitive, though effective, general purpose Twisted memory debugging tool.

It is called TwistedElephant.

It lives in my personal SVN repository at red-bean:

http://svn.red-bean.com/bbum/trunk/hacques/TwistedElephant/

It includes some quick documentation.

Note that it is a complete hack that was just good enough to solve a set of memory debugging problems that I had at the time. There are dozens of improvements that can be made and likely some great bugs, too.

Patches welcome!



Leave a Reply

Line and paragraph breaks automatic.
XHTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>