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)) > > and looking at the memory consumption of the process. The same happens with: > > for i in range(1000000): > numarray.asarray(numpy.zeros(dtype=numpy.float64, shape=3)) > > However, the numpy<--numarray sense seems to work well. > > for i in range(1000000): > numpy.array(numarray.zeros(type="Float64", shape=3)) > > Using numarray 1.5.1 and numpy 1.0b1 > > I think this is a relatively important problem, because it somewhat prevents > a > smooth transition from numarray to NumPy. > > Thanks, > > I looked at this a little with a debug python and figure it's a bug in numpy.zeros():
>>> numpy.zeros(dtype=numpy.float64, shape=3) array([ 0., 0., 0.]) [147752 refs] >>> numpy.zeros(dtype=numpy.float64, shape=3) array([ 0., 0., 0.]) [147753 refs] >>> numpy.zeros(dtype=numpy.float64, shape=3) array([ 0., 0., 0.]) [147754 refs] >>> numarray.array([1,2,3,4]) array([1, 2, 3, 4]) [147772 refs] >>> numarray.array([1,2,3,4]) array([1, 2, 3, 4]) [147772 refs] >>> numarray.array([1,2,3,4]) array([1, 2, 3, 4]) [147772 refs] Regards, Todd ------------------------------------------------------------------------- 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