[Twisted-web] Guard, LastPage Memory Leak?
federicotom at yahoo.it
Wed Jul 29 19:34:26 EDT 2009
Jean-Paul Calderone wrote:
>>Ok, this minimal server application proofs that a memory
>>leak exists somewhere. This is already a good result.
> I messed around with this for a while. Unfortunately, I am not able
> to reproduce a memory leak using it. I found some things which I find
> suspicious in Nevow, but none of them explains a leak.
Are you saying that you are not sure about memory leaks
The previous example allocates memory such way:
def afterRender(self, *a):
self.foo= ['a' * (10**6) for i in xrange(100)]
When logout, memory remains allocated unless you
create a destroyer method that deletes the foo
attr before the exit, explicitley.
Memory leaks appears also when rend.Page.data_bar()
is used. Both cases seem to be related to WovenContext
and docFactory (a lot of WovenCtx and IMacroFactory
instances seems to stick in docFactory._cache).
In fact, this part of nevow is simply a Memory
Blackhole. Inside docFactory._cache one can find
various sticky objects.
So, why "you are not able to reproduce it"?
This is a *really heavy* problem. So, imho, nevow
should work on it with energies.
Maybe the better way is to redesign WovenCtx machinery,
as Jean-Paul suggested. But it's absolutely important
to make an intervention.
I can help. If we need to redesign WovenCtx and someone
is able to guide my work (requiring to me precise APIs
or Classes), you can rely on my contribution.
Today is Setting Orange, the 64th day of Confusion in the YOLD 3175
More information about the Twisted-web