I've been trying to debug a memory leak in the Coopr package using objgraph: https://gist.github.com/3855150
I have it pinned down to a _SetContainer
object, but can't seem to figure out why that object is persisting in memory. Here's the result of objgraph.show_refs
:
How do I go about finding the circular reference and how can I get the the garbage collector to collect the _SetContainer
instance?
I previously thought that the class itself might have a self-reference (the tuple just below the class on the right in the image above). But objgraph always shows inherited classes always as having a self-referencing tuple. You can see a very simple test case here.