Popular Python recipes tagged "getsizeof"http://code.activestate.com/recipes/langs/python/tags/getsizeof/2017-07-22T15:52:01-07:00ActiveState Code RecipesSize of Python objects (revised). (Python) 2017-07-22T15:52:01-07:00Jean Brouwershttp://code.activestate.com/recipes/users/2984142/http://code.activestate.com/recipes/546530-size-of-python-objects-revised/ <p style="color: grey"> Python recipe 546530 by <a href="/recipes/users/2984142/">Jean Brouwers</a> (<a href="/recipes/tags/getsizeof/">getsizeof</a>, <a href="/recipes/tags/memory/">memory</a>, <a href="/recipes/tags/sizeof/">sizeof</a>). Revision 21. </p> <p>This recipe determines the size of Python objects in bytes and has been further enhanced to handle ints, namedtuples, arrays and NumPy types better. Functions <em>alen</em> and <em>itemsize</em> have been updated. Support for Python 2.5 and earlier and the tests/examples have been removed. See project <a href="https://github.com/pympler/pympler">Pympler</a> for unit tests.</p> <p>See also other, simpler recipes like this <a href="http://code.activestate.com/recipes/577504">Compute memory footprint of an object and its contents</a>.</p>