-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fix memory leak in Rolling.min and Rolling.max (#25893) #25926
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #25926 +/- ##
==========================================
- Coverage 91.8% 91.79% -0.01%
==========================================
Files 174 174
Lines 52536 52536
==========================================
- Hits 48231 48226 -5
- Misses 4305 4310 +5
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25926 +/- ##
==========================================
+ Coverage 91.81% 91.81% +<.01%
==========================================
Files 175 175
Lines 52578 52580 +2
==========================================
+ Hits 48273 48275 +2
Misses 4305 4305
Continue to review full report at Codecov.
|
Can we add a memory ASV to measure this?
…Sent from my iPhone
On Mar 29, 2019, at 4:19 PM, codecov[bot] ***@***.***> wrote:
Codecov Report
Merging #25926 into master will decrease coverage by <.01%.
The diff coverage is n/a.
@@ Coverage Diff @@
## master #25926 +/- ##
==========================================
- Coverage 91.8% 91.79% -0.01%
==========================================
Files 174 174
Lines 52536 52536
==========================================
- Hits 48231 48226 -5
- Misses 4305 4310 +5
Flag Coverage Δ
#multiple 90.35% <ø> (ø) ⬆️
#single 41.88% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 75% <0%> (-12.5%) ⬇️
pandas/core/frame.py 96.79% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.63% <0%> (-0.11%) ⬇️
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d4c89f...f055be9. Read the comment docs.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This looks harmless and I'm happy to take your word for it that it fixes the referenced issue. A couple of small requests commented inline |
not necessarily part of this PR, but this file uses out-of-date no-python for-loop syntax, can be updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a memory asv. can you show a %memit
before and after this PR as well.
Here are the Function definition:
Master:
PR:
I'll work on adding an asv test for this. |
So, while writing the ASV tests, I learned that this bug doesn't actually affect But that makes the fix even easier! Since they aren't used, just remove them, no changing anything to memoryviews at all. Anyway, here are the ASV results:
Some notes on the ASV tests are in the code PR comments. |
thanks @ArtificialQualia |
numpy/numpy#13237 opened |
git diff upstream/master -u -- "*.py" | flake8 --diff
This fixes an issue that caused a memory leak in
window._roll_min_max
. Apparently, when you pass an ndarray as an argument that youcdef
ed in the calling function, that memory never gets released. This is not an issue unique to pandas, as evidenced by this stackflow question. It may be a numpy bug.There are a few potential fixes for this:
As memoryviews is the least disruptive change and is just as performant as what was already being used, that's what I went with for this fix.
I did not add a test with this PR, as determining memory usage is platform specific (and rather wonky) unless you use a library like
psutils
, and even with that may have problems.