Python line-by-line memory profiler?

Viewed 3018

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.

I'm familiar with heapy, 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 line_profiler, but that works with run time, not memory.

My fallback right now is Valgrind with massif, 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?

2 Answers
Related