ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
[Numpy-discussion] Numeric memory leak when building Numeric.array from numarray.array
by Alexandre Fayolle other posts by this author
Dec 7 2006 7:50AM messages near this date
[Numpy-discussion] numarray-1.5.2 and Py_NONE refcount crash | Re: [Numpy-discussion] Numeric memory leak when building Numeric.array from numarray.array
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/
Thread:
Alexandre Fayolle
Francesc Altet
Alexandre Fayolle
Francesc Altet

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved