[Numpy-discussion] Memory leak
Charles R Harris
charlesr.harris at gmail.com
Thu Jun 13 11:04:40 EDT 2013
On Thu, Jun 13, 2013 at 8:56 AM, Aron Ahmadia <aron at ahmadia.net> wrote:
> Hi Petro,
> What version of numpy are you running?
> On Thu, Jun 13, 2013 at 3:50 PM, Pietro Bonfa' <pietro.bonfa at fis.unipr.it>wrote:
>> Dear Numpy users,
>> I have a memory leak in my code. A simple way to reproduce my problem is:
>> import numpy
>> class test():
>> def __init__(self):
>> def t(self):
>> temp = numpy.zeros([200,100,100])
>> A = numpy.zeros(, dtype = numpy.float)
>> for i in range(200):
>> A[i] = numpy.sum( temp[i].diagonal() )
>> return A
>> a = test()
>> c = [a.t() for i in range(100)]
>> Running this script will require 1.5 Gb of memory since the 16 mb of
>> temp arrays are never deallocated.
>> How can I solve this problem?
>> Thanks in advances,
>> Pietro Bonfa'
>> P.S: I asked the same question also on stack overflow
IIRC, there was a memory leak with diagonal in 1.7.0 that was fixed in
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion