[Tutor] Memory Leak?

Michael Langford mlangford.cs03 at gtalumni.org
Thu May 8 17:48:42 CEST 2008


>
> >>You can always make a subclass of the classes you're thinking aren't
> being
> >>garbage collected and put a print statement in their __del__ functions to
> >>show you when they are. That will show you if/which objects aren't being
> >>deleted.
>
> Is this reliable or will this just confuse the issue?
>
> Python in a Nutshell states "While gc itself can automatically fix many
> leaks (as long as you avoid defining __del__ in your classes, since the
> existence of __del__ can block cyclic garbage collection), your program runs
> faster if it avoids creating cyclic garbage in the first place
>
>
Yes is it reliable if you are intending to have non-cyclic data in the first
place (which has no chance of no being gc-ed). This sounds like  his use
case.

                   --Michael

-- 
Michael Langford
Phone: 404-386-0495
Consulting: http://www.RowdyLabs.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080508/7bedc378/attachment.htm>


More information about the Tutor mailing list