Search code examples
pythondjangopython-2.7heapy

Expand truncated object view in python heapy / guppy


I have a memory leak in my django app and used heapy to debug the memory stack. I believe I finally came to the cause of the problem. Now I need a way to expand that truncated representation of the string, so I can identify the source. Is there a way to do this in guppy?

Set of 1 object. Total size = 4831096 bytes. Index Size % Cumulative % Representation (limited) 0 4831096 100.0
4831096 100.0 u'< {"to...]}}}]}}}'

This is what I doing currently

from guppy import hpy
h = hpy()
print h.heap()[0].byrcs[0].byid[0]

Solution

  • You should be able to use the .theone attribute to see the full representation, eg

    h.heap()[0].byrcs[0].byid[0].theone