Greg Hazel <gha...@users.sourceforge.net> added the comment:

This is still an issue.

The bug I'm reporting had been explained well, I thought, but I'll repeat it in 
summary:
There is no way to pass around traceback objects without holding references to 
an excessive number of objects.

Traceback raising typically does not use these references at all, so having 
some way to discard them would be very valuable. This allows storing and 
passing tracebacks between threads (or coroutines or async tasks) without dying 
quickly due to memory bloat. The simple-minded way to fix this is to allow the 
user to break the reference themselves.

Fixing this bug would invalidate the need for hacks like the one Twisted has 
come up with in their twisted.python.Failure object which stringifies the 
traceback object, making it impossible to re-raise the exception. Failure has a 
lot of re-implementations of Exceptions and traceback objects as a result.

----------
status: closed -> open
title: gc allowing tracebacks to eat up memory -> tracebacks eat up memory by 
holding references to locals and globals when they are not wanted
versions: +Python 2.6, Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1565525>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to