[Tutor] numpy memory muncher
python at venix.com
Mon Nov 13 21:05:03 CET 2006
On Sat, 2006-11-11 at 15:40 -0500, Joel Levine wrote:
> I'm using, perhaps misusing numpy which is eating up the memory and,
> eventually crashing my program.
I can reproduce the problem on my Linux system, so it is not Mac
specific. Using xrange makes no difference.
does not cause the memory usage to grow.
I guess numpy needs to allocate some memory when binding a python
variable to an array element. This memory does not appear to get
released when the python variable is deleted or passes out of scope.
The gc (garbage collector) module did not shed any light for me.
> Isolating it, the following piece of code continually eats memory. Is it my program or what ...?
> Joel Levine
> Using Mac OSX 10.4.7
> Not clear on versions: Appears to be 0.9.8 with py2.4
> from numpy import *
> while True:
> for row in range(2000):
> for col in range(100):
> #if x!=0: print "?"
> Tutor maillist - Tutor at python.org
More information about the Tutor