title: memory size of Python data structure
body: <p>How do I find out the memory size of a Python data structure? I'm looking for something like:</p>
  
  <pre><code>sizeof({1:'hello', 2:'world'})
  </code></pre>
  
  <p>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.</p>
  
  <p>My current dev platform is CPython 2.6.</p>