Skip to content Skip to sidebar Skip to footer

Python 2.7 Memory Leak With Scipy.minimze

During a fit procedure, my RAM memory slowly but steadily (about 2.8 mb every couple of seconds) increases until I get a memory error or I terminate the program. This happens when

Solution 1:

I narrowed down the problem by successively removing layer after layer of indirection. (@joris267 This is something you really should have done yourself before asking.) The minimal remaining code to reproduce the problem looks like this:

import scipy.integrate

if __name__=="__main__":    
    while True:
        scipy.integrate.quad(lambda r: 0, 1, 100)

Conclusion:

  1. Yes, there is e memory leak.
  2. No, the leak is not in scipy.minimize but in scipy.quad.

However, this is a known issue with scipy 0.19.0. Upgrade to 0.19.1 should supposedly fix the problem, but I don't know for sure because I'm still with 0.19.0 myself :)

Update:

After upgrading scipy to 0.19.1 (and numpy to 1.13.3 for compatibility) the leak disapeared on my system.


Post a Comment for "Python 2.7 Memory Leak With Scipy.minimze"