python 检查内存

################################
# 测试函数运行内存
# coding=utf-8
# pip install memory_profiler
# pip install psutil
# 在pycharm包管理器里装
from memory_profiler import profile


@profile
def test():
list_m = []

for i in range(1000000):
list_m.append(i)

print len(list_m)


test()
################################

原文地址:https://www.cnblogs.com/danny-chen/p/6202566.html