Bernhard Reimar Hoefle wrote: > I have the following python script: > ####################################### > from numarray import * > > while 1: > a=arange(1,300000000) > b=a*100/100 > del a > del b > ####################################### > > This script crashes after a few minutes with an error: > > MemoryError: Couldn't allocate requested memory > > How can I avoid python to use new memory space for each loop?
It's entirely possible that you're running out of memory *during* the first loop. The a array takes up over 1Gb by itself. a*100 is a temporary array that takes another 1Gb, and finally b takes up another 1Gb. So you have over 3Gb that's trying to exist at the same time. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list