How to check what is holding reference to object

Chris Rebert clp2 at
Tue Apr 27 17:08:36 EDT 2010

On Tue, Apr 27, 2010 at 1:45 PM, Michal M <mich.mierzwa at> wrote:
> I've just found out that one of objects is not destroyed when it
> should be. This means that something was holding reference to this
> object or part of it (i.e. method). Is there any way to check what
> holds that reference? I am unable to do that just looking to the code
> or debugging it because it is pretty complicated, but I am able to
> invoke this situation again.

gc.get_referrers(your_object) ?


Thanks for having me learn something new today!

More information about the Python-list mailing list