今天一哥们说他内存曲线是均匀锯齿状。这对python太简单了,就是对内存添写和释放就行。我无聊之下写了下面的代码。
import StringIO
import time
for i in range(100):
context = a * 2048 * 100000
a=StringIO.StringIO(context)
time.sleep(2)
a.close()
context = b * 1024 * 10
a=StringIO.StringIO(context)
time.sleep(1)
a.close()

发表评论