Author vstinner
Recipients pitrou, serhiy.storchaka, vstinner
Date 2015-01-31.01:10:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422666621.56.0.0799265434782.issue23353@psf.upfronthosting.co.za>
In-reply-to
Content
Oh, by the way: keeping the exception after the except block is also a tricky reference leak. In Python 3, since exceptions store their traceback, this issue may keep a lot of objects alive too long, whereas they are expected to be destroyed much earlier.

When I started to investigate this issue, it took me 2 hours to begin to understand why so many objects were kept alive. It looks like a reference cycle, a reference leak, or other kind of complex memory leak. Clearing manually local variables (ex: "self = None" in methods) is not enough.

Python 2 has a sys.exc_clear() method which can be used to workaround this issue. It cannot be used in Python 3 since the function was removed in Python 3.
History
Date User Action Args
2015-01-31 01:10:21vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka
2015-01-31 01:10:21vstinnersetmessageid: <1422666621.56.0.0799265434782.issue23353@psf.upfronthosting.co.za>
2015-01-31 01:10:21vstinnerlinkissue23353 messages
2015-01-31 01:10:21vstinnercreate