New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NDDataArray - using weakref for uncertainty and include it in tests #4825
Comments
@MSeifert04 , do you have more info on the memory leak, say, from a diagnostic tool? |
This was the quick test I originally made (slightly adapted though). For simplicity I've created a function that creates the NDDataArray but doesn't return it. That should immediatly trigger cleanup of any not returned variables. (The results also look the same if I
CurrentlyWithout uncertainty (no memory leak)
With uncertainty (potential memory leak)
This clearly shows a linearly increasing memory usage which might indicate that the object cannot be deallocated when the function exits. That the memory consumption is identical inside and outside the function is another hint. The initial failing Travis tests (from #4799) complaining about "open files" yet another indicator. Using the version from the current PR (memory leak fixed)
With the |
I hope that's somehow convincing. 😄 If unclear (sorry I was in a hurry when creating these figures) I can update the plots and analysis. |
Just want to be clear -- You mentioned two different PRs above. Which one actually has the fix? |
But the PR (#4799) isn't about the fix. The fix was just included to deal with the test-failures. |
I've edited the plots a bit. Is that sufficient to conclude that there is a memory-leak? |
Thanks for the plots! @mwcraig ? |
@plim I'll get to this and the other nddata PRs on Wednesday, will try to hit this one tomorrow. |
@MSeifert04 wow, sorry it took so long to actually look at this. If you could separate the memory leak (which I think MUST get into 1.2 if at all possible) from the broader IO pR #4799 that would be AWESOME! |
Hmm, hadn't thought about it that way.... |
@MSeifert04 -- is the memory leak part of this fixed in #4862? A separate issue has been opened for potential renaming/reorganization of classes. If this is fixed now, please close (and thanks again for fixing and finding this). |
@mwcraig I'll submit a PR to make sure it's fixed for NDDataArray too. |
In #4799 I realized that the current hardlinking between
NDData
anduncertainty
leads to a memory leak. I don't want to update it in that PR but if the PR get's merged I (or someone) else need to edit theuncertainty.setter
ofNDDataArray
too.Maybe even deprecating
NDDataArray
ifNDDataRef
from #4797 is merged. But at leastccdproc
is still using it.Also currently there are few tests concerning
NDDataArray
. One possibility would be to includeccdproc
and other affiliated packages that useNDData
-derivatives into the tests or make the Mixin tests also includeNDDataArray
.The text was updated successfully, but these errors were encountered: