Memory manipulation
memory_utils.py
# -*- coding: utf-8 -*-
import memory_utils as memo
x = []
for i in xrange(100000):
x.append(i)
#Set memory limit
memo.set_memory_limit(12800000)
#Raise an exception if the limit is exceeded
memo.check_memory()
#Memory print
memo.print_memory()
Recommended Posts