Much reduced code exhibiting the issue. This shouldn't use much memory but just keeps going up and up because the copied window I assume gets left around and not taken up by the garbage collector.

On 22/05/11 23:42, Ralf Gommers wrote:


On Sun, May 22, 2011 at 2:54 PM, Jeffrey Spencer <[email protected] <mailto:[email protected]>> wrote:

    Sorry. I attached here the class and script to run it. It is just
    a minimalistic example of what I'm really doing that exhibits the
    same behavior. All the script does is run at.createSpecific after
    instantiating the class. I have seen this exhibited on many other
    cases but it runs fine in Windows XP. Here is what the script does:

    import MemoryLeak
    at = MemoryLeak.Model()
    at.createSpecific()

That manages to eat up all my cpu cycles for about 5 minutes, but no leak (on OS X). I also don't see anything in the code that can potentially give problems. I suggest you strip this down a lot more so you can isolate the problem.

If in your original code you were making a lot of figures in one of those for loops without explicitly closing them, that could perhaps be a problem. But you removed all I/O and matplotlib related code already (except for imports and some keywords).

Ralf
from numpy import zeros, ones, max, copy, arange
    
def innerTest(window):
    temper = copy(window)
    sider = 7
    st = .04
    sizer = temper.size
    inhibVal = 0
    for j in xrange(sider):
        inhibVal = (temper[0:j+sider+1].sum())*(sider*2+1)/(sider+1+j)
        window[j] += - st*(inhibVal)
    for j in xrange(sider,sizer - sider):
        inhibVal = temper[j-sider:j+sider+1].sum()
        window[j] += - st*(inhibVal)
    for j in xrange(sizer-sider, sizer):
        inhibVal = (temper[j-sider:sizer].sum())*(sider*2+1)/(sider+sizer-j)
        window[j] += - st*(inhibVal)
    return window

for x in range(10000):
        #inhibitWindowArray[0,0] = train( arange(10000))
        innerTest(arange(400))

_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to