It is a bit of a puzzle to me.

On Jan 9, 3:34 pm, Jonathan Lundell <jlund...@pobox.com> wrote:
> On Jan 9, 2011, at 1:20 PM, Massimo Di Pierro wrote:
>
>
>
> > correct.
>
> Isn't the need to call gc.collect() explicitly a bit of a puzzle? Or is it 
> just speeding up something that would happen eventually?
>
>
>
>
>
>
>
>
>
> > On Jan 9, 1:18 pm, Anthony <abasta...@gmail.com> wrote:
> >> On Sunday, January 9, 2011 12:59:47 AM UTC-5, ron_m wrote:
>
> >>> To get the leak the __del__method has to be in the class. The gc.collect()
> >>> as suggested by Massimo cured the leak for the exec code case I believe
> >>> because gc.collect() runs a test on the objects to see if there are any
> >>> external references, finds none, and therefore allows them to be removed
> >>> from the heap.
>
> >> Sorry if I'm being dense, but to be clear, the leak can happen with exec
> >> even if the class does not have a __del__ method (i.e., web2py's case), and
> >> that kind of leak can be prevented using gc.collect (the recent fix put 
> >> into
> >> place). However, if the class has a __del__ method, you get a leak even if
> >> exec is not being used, and that kind of leak is not resolved by 
> >> gc.collect.
> >> Is that right?

Reply via email to