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()
################################

posted @ 2016-12-20 14:35  小小白鼠  阅读(351)  评论(0编辑  收藏  举报