-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Fix mem leak in read_csv #57084
Fix mem leak in read_csv #57084
Conversation
@akrherz do you have a quick way of checking this? |
@WillAyd I am sorry, I have never built pandas before, but will try it now. I certainly appreciate the help here. |
@WillAyd could you add a |
I've added, but in this case it unfortunately would not have made a difference because the extension uses the system Maybe we should use PyMem_Free, although the downside to that would be that it doesn't play nicely with LSAN |
I don't wish to waste dev's time here, but I am curious why the introduction of |
Thanks @WillAyd |
I think np.nan is a red herring - it is definitely a mistake in the code to get rid of those free blocks and LSAN detects the leak either way Thanks again for the quick report! |
Thank you, but the memory leak does not happen with that line removed. Regardless, I am thrilled this is fixed :) |
Backport PR #57084: Fix mem leak in read_csv Co-authored-by: William Ayd <will_ayd@innobi.io>
* Fix memory leak in read_csv * whatsnew * peakmem benchmark
Pending validation but I believe this fixes #57039
Initially I misread this function was branching based off a return value that was always 0, but the actual value lies in the side effects