[SciPy-User] Potential KDTree memory leak

Robert Kern robert.kern@gmail....
Thu Mar 11 09:50:07 CST 2010


On Thu, Mar 11, 2010 at 07:19, Pierre Lamon <pierre.lamon@bluebotics.com> wrote:
> Hi all,
>
> the memory increases at each iteration of the following program:
>
> from numpy import ndarray
> from scipy.spatial import KDTree
>
> class C(ndarray):
>     pass
>
> pts = [C((2,)) for i in range(1000)]
> for i in xrange(10000):
>     tree = KDTree(pts)
>
> It does not occur when using the base class ndarray instead. I've only
> tested on a windows machine. Any idea what happens?

With recent SVN versions of numpy and scipy, I do not see a leak.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco


More information about the SciPy-User mailing list