Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Facundo Batista
On Tue, Jan 22, 2013 at 2:37 PM, Phil Mayers wrote: > Because having just tested it, I don't see any problem - his example > code has stable memory usage for both client/server processes, and with > the client making 1, 100 or 1000 connections/sec, and the debug shows > protocol and factory insta

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Phil Mayers
On 22/01/13 17:06, Facundo Batista wrote: > On Tue, Jan 22, 2013 at 2:02 PM, Phil Mayers wrote: > >> On 22/01/13 16:45, Facundo Batista wrote: >>> >>> Yes, but note that without the __del__ it had the same behaviour... >>> >> >> Not quite. The OP said that: >> >>a) He had a problem with a Twis

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Facundo Batista
On Tue, Jan 22, 2013 at 2:02 PM, Phil Mayers wrote: > On 22/01/13 16:45, Facundo Batista wrote: >> >> Yes, but note that without the __del__ it had the same behaviour... >> > > Not quite. The OP said that: > > a) He had a problem with a Twisted app not freeing memory under load > b) He had re

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Phil Mayers
On 22/01/13 16:45, Facundo Batista wrote: > > Yes, but note that without the __del__ it had the same behaviour... > Not quite. The OP said that: a) He had a problem with a Twisted app not freeing memory under load b) He had reproduced that problem with his example, that included __del__ Nowh

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Facundo Batista
On Tue, Jan 22, 2013 at 12:15 PM, Tristan Seligmann wrote: > Adding __del__ methods causes the object to become uncollectable if it > forms part of a reference cycle. Thus it is almost always a bad idea > to add __del__ methods when attempting to debug a space leak, as the > most likely outcome i

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Diego Woitasen
El 22/01/2013 12:22, "Tristan Seligmann" escribió: > > On Tue, Jan 22, 2013 at 3: > > On Tue, Jan 22, 2013 at 3:06 PM, Diego Woitasen > wrote: > > I reproduce the problem with a modification of Echo client example > > from Twisted documentation: > > Adding __del__ methods causes the object to bec

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Phil Mayers
On 22/01/13 15:15, Tristan Seligmann wrote: > On Tue, Jan 22, 2013 at 3:06 PM, Diego Woitasen wrote: >> I reproduce the problem with a modification of Echo client example >> from Twisted documentation: > > Adding __del__ methods causes the object to become uncollectable if it Ah yes, well spotted

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Christopher Armstrong
On Tue, Jan 22, 2013 at 9:15 AM, Tristan Seligmann wrote: > On Tue, Jan 22, 2013 at 3:06 PM, Diego Woitasen > wrote: > > I reproduce the problem with a modification of Echo client example > > from Twisted documentation: > > Adding __del__ methods causes the object to become uncollectable if it >

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Tristan Seligmann
On Tue, Jan 22, 2013 at 3:06 PM, Diego Woitasen wrote: > I reproduce the problem with a modification of Echo client example > from Twisted documentation: Adding __del__ methods causes the object to become uncollectable if it forms part of a reference cycle. Thus it is almost always a bad idea to

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Diego Woitasen
On Tue, Jan 22, 2013 at 11:03 AM, Phil Mayers wrote: > On 22/01/13 13:54, Diego Woitasen wrote: > >> Ok, that's work. Thanks. >> >> My question is now, why is this done automatically for EchoProtocol() >> and not for EchoFactory()? Looks like the references are dropped why >> Python is taking too

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Phil Mayers
On 22/01/13 13:54, Diego Woitasen wrote: > Ok, that's work. Thanks. > > My question is now, why is this done automatically for EchoProtocol() > and not for EchoFactory()? Looks like the references are dropped why > Python is taking too much time to frees the memory. > > An explanation around this

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Diego Woitasen
On Tue, Jan 22, 2013 at 10:38 AM, Marco Giusti wrote: > On Tue, Jan 22, 2013 at 10:18:13AM -0300, Diego Woitasen wrote: >> Here is the server code if you want to have a test: > [cut] >> >> Thanks! >> >> On Tue, Jan 22, 2013 at 10:06 AM, Diego Woitasen >> wrote: >> > I have an Twisted client app

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Marco Giusti
On Tue, Jan 22, 2013 at 10:18:13AM -0300, Diego Woitasen wrote: > Here is the server code if you want to have a test: [cut] > > Thanks! > > On Tue, Jan 22, 2013 at 10:06 AM, Diego Woitasen > wrote: > > I have an Twisted client app that makes hundreds of connections per > > minute. I discover th

Re: [Twisted-Python] Twisted client memory leak

2013-01-22 Thread Diego Woitasen
Here is the server code if you want to have a test: from twisted.internet.protocol import Protocol from twisted.internet.protocol import Factory from twisted.internet import reactor class Echo(Protocol): def __init__(self, factory): self.factory = factory def connectionMade(sel