I am trying to track a memory leak in Python (2.7). I found gc.get_referrers but don't understand the way out. After removing dying_node (which should get rid of all the links except the list that I created as part of my hunt), I have in my code:
gc.collect() print "done dying: ", getrefcount(dying_node)
which gives an output:
> done dying: 4 > referrers: > [<__main__.Node instance at 0x104e53cb0>, <__main__.Node instance at 0x104e53b90>, <__main__.Node instance at 0x104e53b00>, <__main__.Node instance at 0x104e53d40>, <__main__.Node instance at 0x104e53ab8>, <__main__.Node instance at 0x104e53bd8>, <__main__.Node instance at 0x104e53a70>, <__main__.Node instance at 0x104e53c20>, <__main__.Node instance at 0x104e53c68>, <__main__.Node instance at 0x104e53b48>] > [<__main__.Node instance at 0x104e53c20>, <__main__.Node instance at 0x104e53ab8>, <__main__.Node instance at 0x104e53c68>, <__main__.Node instance at 0x104e53a70>, <__main__.Node instance at 0x104e53cb0>, <__main__.Node instance at 0x104e53b00>, <__main__.Node instance at 0x104e53d40>, <__main__.Node instance at 0x104e53b90>, <__main__.Node instance at 0x104e53b48>, <__main__.Node instance at 0x104e53bd8>] > <frame object at 0x104516300>
I think this means that I have two Node lists that apply to this node and to the frame object. I assume that the frame object is the name dying_node that I am looking at. One of the lists will be a list that I created to help me in my hunt. But is there any way to figure out what the other list will be?
source share