Memory leak involving traceback objects

Aahz aahz at pythoncraft.com
Thu Jul 16 10:22:16 EDT 2009


In article <e6e9b9ea-1f8c-4695-90da-72e85c8a63e4 at v20g2000yqm.googlegroups.com>,
Rotem  <vmalloc at gmail.com> wrote:
>
>I'm debugging a nasty memory leak in a framework written in Python
>(v2.6.2).
>After much digging around I found that the entire object group that is
>leaking is held by a frame object which is subsequently held by a
>traceback object.
>
>Traversing the get_referrers() of each traceback frame leads
>eventually to a root traceback frame which has no referrers
>(gc.get_referrers returns an empty list).
>
>However, this traceback object seems not to be picked by the garbage
>collector, and is still there even after many iterations and calls to
>gc.collect(). The code location to which the traceback frame points
>doesn't do anything special - it just catches an exception, without
>saving the exception itself and/or traceback anywhere.

What *does* it do?  Does it re-raise?  This sounds like you're still in
block scope of an exception.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair



More information about the Python-list mailing list