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 rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4