How to get memory size/usage of python object

Fredrik Lundh fredrik at pythonware.com
Wed Jan 9 09:57:51 EST 2008


Santiago Romero wrote:

>  Is there a way to check the REAL size in memory of a python object?

in standard Python, without reading the interpreter source code 
carefully, no.

to get an approximate value, create a thousand (or a million) objects 
and check how much the interpreter grows when you do that.

</F>




More information about the Python-list mailing list