Hi,

I'm facing a memory leak on an application that has to use numarray and
Numeric (because of external dependencies). 

The problem occurs when building a Numeric array from a numarray array:

import Numeric
import numarray
import sys
atest = numarray.arange(200)
temp =  Numeric.array(atest)
print sys.getrefcount(atest) # prints 3
print sys.getrefcount(temp)  # prints 2

I'm running numarray 1.5.2 and Numeric 24.2

I can work around this by using an intermediate string representation:

temp = Numeric.fromstring(atest.tostring(), atest.typecode())
temp.shape = atest.shape



-- 
Alexandre Fayolle                              LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian:  http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
Informatique scientifique:               http://www.logilab.fr/science
Reprise et maintenance de sites CPS:     http://www.migration-cms.com/

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to