views:

117

answers:

2

I am investigating garbage collection issues in a Python app. What would be the best readable option to print out all variables referencing a specific instance?

+2  A: 

Use the inspect module. This script helps if you just want to track down reference leaks:

http://mg.pov.lt/objgraph.py http://mg.pov.lt/blog/hunting-python-memleaks http://mg.pov.lt/blog/python-object-graphs.html

Glenn Maynard
+2  A: 

Try Finding objects' names, it prints all names that reference a given object.

wierob