How do I find out the memory size of a Python data structure? I'm looking for something like:
sizeof({1:'hello', 2:'world'})
It is great if it counts every thing recursively. But even a basic non-recursive result helps. Basically I want to get a sense of various implementation options like tuple v.s. list v.s. class in terms of memory footprint. It matters because I'm planning to have millions of object instantiated.
My current dev platform is CPython 2.6.