title: Python: memory usage statistics per object-types (or source code line)
body: <p>I am doing some heavy calculations with Python (using OpenCV and Numpy) and in the end, I end up with a lot of memory usage (>1GB) whereby all refs should be gone and I only have the end-result (which should not be more than a few MB).</p>
  
  <p>To debug this, it would be nice if I could get some stats somehow which show me how much object instances there are of what type, ordered by the total amount of memory they take (per object class).</p>
  
  <p>Or even nicer: Not per object class but per source code line where the object was created (whereby I guess this info is not available unless I activate some debugging in Python which would make the calculation too slow, so I am not sure if that would be helpful).</p>
  
  <p>Can I get some stats like this somehow? Or how would I debug this?</p>
  
  <hr>
  
  <p>Some has missunderstood me: I <em>only</em> need to know how to debug the memory usage. Processing/run- time is perfect.</p>