[Twisted-Python] help with refcounts and memleaks

Moe Aboulkheir moe at divmod.com
Mon Dec 26 19:39:30 EST 2005

On Tue, 27 Dec 2005 01:18:33 +0100, Andrea Arcangeli <andrea at cpushare.com> wrote:

>But then while trying to debug the 50M leak in the client at every
>server restart (so very visible), I quickly into this:
>	http://www.nightmare.com/medusa/memory-leaks.html
>class thing:
>    pass
>a = thing()
>b = thing()
>a.other = b
>b.other = a
>del a
>del b
>Code like above is very common in my twisted based server. Note that
>there's no __del__ method in the class "thing". So what you say seems in
>disagreement with the above url. Perhaps I got bitten by the common
>mistake "I found it on the internet so it must be true"...

the document at that URL is six years old, and so dates from a time when python's garbage collector couldn't properly deal with plain cyclical references, AFAICT.

Moe Aboulkheir

More information about the Twisted-Python mailing list