Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
This patch corrected the problem for me, numpy test pass... On 8/2/07, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > I think the problem is in _array_fromobject (seen as numpy.array in Python) -- Lisandro Dalcín --- Centro Internacional de Métodos Computacionales en Ingeniería (CIM

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
I think the problem is in _array_fromobject (seen as numpy.array in Python) This function parses its arguments by using the convertor PyArray_DescrConverter2. which RETURNS A NEW REFERENCE!!! This reference is never DECREF'ed. BTW, A lesson I've learned of the pattern if (!PyArg_ParseXXX())

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
Ups, I forgot to mention I was using gc.collect(), I accidentally cleaned it my mail Anyway, the following import sys, gc import numpy def test(): a = numpy.zeros(5, dtype=float) while 1: gc.collect() b = numpy.asarray(a, dtype=float); del b gc.collect() p

Re: [Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Timothy Hochberg
On 8/2/07, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > > using numpy-1.0.3, I believe there are a reference leak somewhere. > Using a debug build of Python 2.5.1 (--with-pydebug), I get the > following > > import sys, gc > import numpy > > def testleaks(func, args=(), kargs={}, repeats=5): > f

[Numpy-discussion] reference leacks in numpy.asarray

2007-08-02 Thread Lisandro Dalcin
using numpy-1.0.3, I believe there are a reference leak somewhere. Using a debug build of Python 2.5.1 (--with-pydebug), I get the following import sys, gc import numpy def testleaks(func, args=(), kargs={}, repeats=5): for i in xrange(repeats): r1 = sys.gettotalrefcount() fun