Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# install the required packages
pip install memory_profiler
pip install matplotlib
# run the profiler to record the memory usage
# sample 0.1s by defaut
mprof run --include-children python
# plot the recorded memory usage
mprof plot --output memory-profile.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment