Detecting memory consumption by Python program

First install the memory_profiler and psutil (psutil is mainly used to improve the performance of memory_profile, recommended) (you can use PIP directly)
PIP install memory_profiler
p install psutil
Mprof run test. Py generates a
results. Dat file, such as “mprofile_20160716170529. Dat”, which records the memory along with the change of time
mprof plot
using the commands in the form of pictures showing
the original:
https://blog.csdn.net/baidu_33122327/article/details/79195176

Read More: