[SciPy-user] memory leak in numarray 1.1

Todd Miller jmiller at stsci.edu
Wed Nov 17 08:04:34 CST 2004


This post eventually found it's way to me via the help at stsci.edu path
and spurred the release of numarray-1.1.1 yesterday.  You can get
numarray-1.1.1 (which addresses this problem and a number of others)
here:

http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=32367

As a rule,  the best place to post about numarray problems and questions is:

numpy-discussion at lists.sf.net

Regards,
Todd

On Sun, 2004-11-14 at 13:44 +0000, Peter Dobcsanyi wrote:
> Hi, 
> 
> I have already started a thread on comp.lang.python about this problem
> but thought would post it here too.
> 
> Calling the following function with a large enough 'n' causes memory
> leak.
> 
>     import numarray as N
> 
>     def loop(n, m=100):
>         for i in xrange(n):
>             a = N.zeros((m,m))
>             N.matrixmultiply(a, a)
> 
> If the matrixmultiply line is commented out, there is no leak, the
> program has a stable memory size.  With n a few hundreds (say n>=500),
> the continuous growth of the program's memory footprint is quite
> noticeable. I am working on Linux (Debian testing), I monitor the memory
> usage of the program by top.  The allocated memory is never released.
> 
> I have noticed this problem of memory leak in connection with numarray a
> few months ago in a program of mine. The program processes the incidence
> matrices of thousands of combinatorial structures read from a file one
> by one. As the number of combinatorial objects went up I started running
> out of memory even on a machine with 2 Gbyte memory and with small
> (m<100) matrices.  It took me a while to pinpoint that it was caused by
> matrix multiplication.
> 
> Following Robert Kern's suggestion I have also tried the development
> version from CVS and that does not leak.
> 
>     Peter
> 
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list