If you want to analyze the memory consumption of your Python code line-by-line, use memory_profiler. This package allows you to generate a full memory usage report of your executable and plot it.
Analyze the Memory Usage of Your Python Code
Table of Contents
