Francesc Altet wrote:
> Hi,
>
> I was tracking down a memory leak in PyTables and it boiled down to a problem 
> in the array protocol. The issue is easily exposed by:
>
> for i in range(1000000):
>     numarray.array(numpy.zeros(dtype=numpy.float64, shape=3))
>
>   
More data:

The following code does not leak:

import numpy
import sys

for i in xrange(10000000):
    a = numpy.zeros(dtype=numpy.float64,shape=3)
    b = a.__array_struct__


as verified by watching the memory growth


As far as numpy knows this is all it's supposed to do.   This seems to 
indicate that something is going on inside numarray.array(a)

because once you had that line to the loop, memory consumption shows up.

In fact, you can just add the line

a = _numarray._array_from_array_struct(a)

to see the memory growth problem. 


-Travis




-Travis



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to