Memory problem

Yi Xing yxing at stanford.edu
Mon Aug 14 15:49:55 EDT 2006


I tried the following code:

>>> i=0
>>> n=2600*2600*30
>>> a=array.array("f")
>>> while (i<=n):
..     i=i+1
..     a.append(float(i))
..
Traceback (most recent call last):
  File "<stdin>", line 3, in ?
MemoryError

to see the size of the array at the time of memory error:
>>>len(a)
8539248.

I use Windows XP x64 with 4GB RAM.



More information about the Python-list mailing list