title: Python line-by-line memory profiler?
body: <p>I'm looking to generate, from a large Python codebase, a summary of heap usage or memory allocations over the course of a function's run.</p>
  
  <p>I'm familiar with <a href="http://guppy-pe.sourceforge.net/" rel="noreferrer">heapy</a>, and it's served me well for taking "snapshots" of the heap at particular points in my code, but I've found it difficult to generate a "memory-over-time" summary with it. I've also played with <a href="http://packages.python.org/line_profiler/" rel="noreferrer">line_profiler</a>, but that works with run time, not memory.</p>
  
  <p>My fallback right now is Valgrind with <a href="http://valgrind.org/docs/manual/ms-manual.html" rel="noreferrer">massif</a>, but that lacks a lot of the contextual Python information that both Heapy and line_profiler give. Is there some sort of combination of the latter two that give a sense of memory usage or heap growth over the execution span of a Python program?</p>