Memory footpring of python objects

BlueBird phil at freehackers.org
Wed Apr 22 11:24:11 CEST 2009


Hi,

I have a program that manages several thousands instances of one
object. To reduce memory
consumption, I want of course that specific object to have the
smallest memory footpring possible.

I have a few ideas that I want to experiment with, like using
__slots__, using a tuple or using a dict. My
question is: how do I know the memory footprint of a given python
object ? I could not find any
builtin functions for this in the documentation.

cheers,

Philippe



More information about the Python-list mailing list