Python memory usage

placid Bulkan at gmail.com
Wed Nov 8 06:42:31 CET 2006


Hi All,

Just wondering when i run the following code;

for i in range(1000000):
     print i

the memory usage of Python spikes and when the range(..) block finishes
execution the memory usage does not drop down. Is there a way of
freeing this memory that range(..) allocated?

I found this document but the fix seems too complicated.

http://www.python.org/pycon/2005/papers/79/python-memory.pdf

Cheers




More information about the Python-list mailing list