This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients gvanrossum, pitrou, vstinner
Date 2013-12-20.22:23:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAP7+vJLJHCGpxq1VPExyhUAmvg2bHb4AbzYGrXtrdQ1ZiRgikA@mail.gmail.com>
In-reply-to <1387577701.69.0.296311867455.issue20032@psf.upfronthosting.co.za>
Content
The cycle will be cleaned up (and the message printed) when the
garbage collector runs next. Your demo doesn't do anything else, so it
never allocates memory, so it never runs gc.collect(). But that's only
because it's a toy program.

Maybe it's time to look into
http://code.google.com/p/tulip/issues/detail?id=42 ? (It proposes to
run gc.collect() occasionally when the loop is idle.)

I am also concerned about Antoine's point -- the patch may actually
*prolong* the life of the traceback.

On Fri, Dec 20, 2013 at 2:15 PM, STINNER Victor <report@bugs.python.org> wrote:
>
> STINNER Victor added the comment:
>
>> Do you have an example of code that behaves differently with this patch?  I can't find any.
>
> I didn't check in the Python standard library, but the reference cycle is obvious, and I hate such issue. It introduces tricky issues like memory leaks.
>
> Here is an example to demonstrate the issue. The "DELETE OBJECT" message is never displayed, so the object is never deleted (memory leak).
>
> Comment "fut.set_exception(err)" line to delete the object, or apply attached patch.
>
> ----------
> Added file: http://bugs.python.org/file33238/never_deleted.py
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue20032>
> _______________________________________
History
Date User Action Args
2013-12-20 22:23:30gvanrossumsetrecipients: + gvanrossum, pitrou, vstinner
2013-12-20 22:23:30gvanrossumlinkissue20032 messages
2013-12-20 22:23:29gvanrossumcreate