python查看进程使用内存信息 psu
翻译自:
https://stackoverflow.com/questions/938733/total-memory-used-by-python-process
psutil官网介绍:Https://GitHub.com/giampaolo/psutil
样例代码如下:
import os,psutil
process = psutil.Process(os.getpid())
print('Used Memory:',process.memory_info().rss / 1024 / 1024,'MB')
相关文章