IPython Notebook magic for function line-by-line memory profiling memprof IPython Notebook magic is based on memory_profiler by Fabian Pedregosa. Installation %install_ext https://raw.githubusercontent.com/HyperionAnalytics/memprof_magic/master/memprof.py Load the magic into the notebook %load_ext memprof Usage %memprof? Example IPython Notebook