On Mon, Mar 28, 2011 at 4:18 PM, Chris Angelico <ros...@gmail.com> wrote: [...] > Obviously I could use PyObject_Str() and PyString_Size() to get a > decent figure, but that seems like overkill. > > What I'm hoping for is some simple function that zips through a > complex object and sums its approximate memory usage. Is there one? [...]
Check out David Malcom's video on memory usage from PyCon 2011 at http://blip.tv/file/4878749 There isn't a direct answer to your question but you might check out the tools he has built as a step in that direction. Michael -- http://mail.python.org/mailman/listinfo/python-list