February 08, 2022

python memory profiler

mprof

  • library that needs to be installed
  • details on memory usage over time, even plots a nice graph
  • memory-profiler

psutil

  • library that needs to be installed
  • details on running processes, system utilisation (CPU, mem, disk, network, sensors) in Python
  • useful for system monitoring, profiling, management of processes, limiting processes
  • psutil

tracemalloc

  • part of python system library, no need to install
  • to find what is hogging the memory or what is leaking by taking snapshots of python memory
  • tracemalloc
  • Fugue blogpost
Read More: