python中获取进程内存相关信息

帮助文档url:https://psutil.readthedocs.io/en/latest/

import os,psutil

process = psutil.Process(4548)#os.getpid()
memInfo = process.memory_info()
print ('tt:',memInfo.rss/1024,'k\n')

关于Process可以查询的信息
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/yuxing55555/article/details/84661156