[Twisted-Python] help with refcounts and memleaks

Thomas HERVE therve at free.fr
Tue Dec 27 03:35:03 EST 2005

Quoting Andrea Arcangeli <andrea at cpushare.com>:

> On Tue, Dec 27, 2005 at 01:47:42PM +1100, Christopher Armstrong wrote:
>>  - gc.collect() is the equivalent of what's run occassionally by
> IMHO the "occasionally" is the only wrong thing of the whole story. It
> must not be "occasionally", it must be "occasionally _or_ when the task
> is growing to an insanse size".

One good way to see the gc in action is to add 
'gc.set_debug(gc.DEBUG_LEAK)' at
the start of your program. Most of the time I realize it's my program fault
when I use this :).

But you may have to adjust the gc threshold in real life application 
(note that
a reconnectingclientfactory with a disconnect every second is not 
exactly a use


More information about the Twisted-Python mailing list