[Numpy-discussion] Memory leak for in-place Numeric+numpy addition
Thomas J. Duck
Wed Jul 25 22:01:05 CDT 2007
There seems to be a memory leak when arrays are added in-place
for mixed Numeric/numpy applications. For example, memory usage
quickly ramps up when the following program is executed:
x = Numeric.zeros((2000,2000),typecode=Numeric.Float64)
for j in range(200):
y = numpy.zeros((2000,2000),dtype=numpy.float64)
x += y
If I use exclusively Numeric arrays, or exclusively numpy arrays, or
add a Numeric array in-place to a numpy array, there is not a
problem. It is only in the case that a numpy array is added in place
to a Numeric array that the leak exists. Deleting the variable y in
each iteration has no effect.
I am using numpy 1.0.1-8 and Numeric 24.2-7 under Debian linux.
I'm not sure if this is a numpy or Numeric problem, but thought
I would send it along in case there is interest and the problem can
be resolved. Unfortunately, I can't move to an exclusively numpy or
Numeric approach because of the other packages that I depend on.
More information about the Numpy-discussion