How to measure the memory cost in Python?
debatem1 at gmail.com
Sat May 2 21:30:42 CEST 2009
> > PS) The asizeof(obj) function from this recipe <http://
> > code.activestate.com/recipes/546530> does size the object plus its
> > references, recursively.
> Correction, the last sentence should be: The asizeof(obj) ... plus its
> referents, recursively.
I will admit, I have *no idea* what that code is doing, but in looking
through the gc module documentation, I'm seeing the gc.get_objects
function. Would it be equivalent to what the OP is asking to track the
size of every element returned by that?
More information about the Python-list