[Twisted-web] Guard, LastPage Memory Leak?

Federico Tomassini federicotom at yahoo.it
Tue Jul 28 12:45:04 EDT 2009


Federico Tomassini wrote:
> 
> Hello,
> 
> I coded a minimal example. Problem seems to depend from
> Bar.data_somedata(). If I remove the interested tag from the
> docFactory, memory is released. When, instead, I use this
> tag (and Bar.data_somedata()), memory is not released:
> 
>    http://dpaste.com/72343/
> 

Ok, this minimal server application proofs that a memory
leak exists somewhere. This is already a good result.

Remember i'm not an expert: I spent many hours to write
this little snippet of code. I spent other hours to
isolate the problem and I have another result.

If we put, on afterRender(), the following:

   def afterRender(self, *a):
     self.docFactory._cache[1].parent.parent= None

the memory leak desappears (at least the greater).
This proofs, I think, that context hier has to be
cleaned somehow. Probably it would be safer to do:

   def afterRender(self, *a):
     self.docFactory._cache[1].parent.parent= None
     self.docFactory._cache[1].parent= None

and maybe:

   def afterRender(self, *a):
     self.docFactory._cache[1].parent.parent= None
     self.docFactory._cache[1].parent= None
     self.docFactory._cacche= None

But this is not a bugfix, This is a proof of blackhole
existence. Is there someone able to locate his origin?

-- 
efphe
Today is Prickle-Prickle, the 63rd day of Confusion in the YOLD 3175



More information about the Twisted-web mailing list