You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory leak in _insert when using rank 0 input (Trac #572) #1170
The function _insert has a memory leak, and this shows when using for example cdf functions of distributions classes in scipy.stats (see scipy #1074).
The fix is trivial: just call Py_DECREF on ainput in rank 0 case, as in general case (the attached patch avoids separate code path for memory cleaning instead).
Well, the memory leak is obvious when looking at the code, since the function arr_insert create a new reference of avals in any case, and this is dereferenced for all cases but rank 0 input.
Your example does not show any leak, indeed... Since the memory leak is obvious, I think we would better apply the patch anyway. I will try to get the test code I used to detect the leak in the first place.
Activity
numpy-gitbot commentedon Oct 19, 2012
Attachment added by @cournape on 2007-08-24: insert.2.fix
numpy-gitbot commentedon Oct 19, 2012
Milestone changed to
1.0.4 Releaseby @alberts on 2007-08-26numpy-gitbot commentedon Oct 19, 2012
@stefanv wrote on 2007-08-28
David, I'd like to write a regression test, but I don't see the same behaviour. Currently, I have:
Would you please send me a snippet that replicates the problem?
numpy-gitbot commentedon Oct 19, 2012
@cournape wrote on 2007-09-05
Well, the memory leak is obvious when looking at the code, since the function arr_insert create a new reference of avals in any case, and this is dereferenced for all cases but rank 0 input.
Your example does not show any leak, indeed... Since the memory leak is obvious, I think we would better apply the patch anyway. I will try to get the test code I used to detect the leak in the first place.
numpy-gitbot commentedon Oct 19, 2012
@cournape wrote on 2007-09-05
Ok, the following code shows the problem:
Running it a few seconds under massif basically shows a linear increase of memory in the while loop.
numpy-gitbot commentedon Oct 19, 2012
@stefanv wrote on 2007-09-20
Fixed by Travis in r4049. Added test in r4053.