Skip to content

COMPAT: free parser memory at close() for non-refcnt gc #15665

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

Closed
wants to merge 1 commit into from

Conversation

mattip
Copy link
Contributor

@mattip mattip commented Mar 12, 2017

relying on __dealloc__ to clean up malloc()ed memory can lead to a perceived "leak" on PyPy since the garbage collector will not necessarily collect the object as soon as its refcnt reaches 0.

Instead, pre-emptively release memory when close() is called

The code still maintains backward compatibility for the case where close() is never called

@codecov-io
Copy link

codecov-io commented Mar 12, 2017

Codecov Report

Merging #15665 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #15665      +/-   ##
==========================================
- Coverage   91.03%   91.01%   -0.03%     
==========================================
  Files         143      143              
  Lines       49382    49382              
==========================================
- Hits        44956    44945      -11     
- Misses       4426     4437      +11
Impacted Files Coverage Δ
pandas/io/gbq.py 25% <0%> (-58.34%)
pandas/tools/merge.py 93.61% <0%> (-0.34%)
pandas/core/frame.py 97.87% <0%> (-0.1%)

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 e0b37f9...eaf50fe. Read the comment docs.

@jreback jreback added the IO CSV read_csv, to_csv label Mar 12, 2017
@jreback jreback added this to the 0.20.0 milestone Mar 12, 2017
@jreback
Copy link
Contributor

jreback commented Mar 12, 2017

@mattip seems reasonable.

@gfyoung any comments?

@gfyoung
Copy link
Member

gfyoung commented Mar 13, 2017

LGTM!

@jreback jreback closed this in 7d04391 Mar 13, 2017
@jreback
Copy link
Contributor

jreback commented Mar 13, 2017

thanks!

AnkurDedania pushed a commit to AnkurDedania/pandas that referenced this pull request Mar 21, 2017
relying on __dealloc__ to clean up malloc() ed memory can lead
to a perceived "leak" on PyPy since the garbage collector will not
necessarily collect the object as soon as its refcnt reaches 0.
Instead, pre-emptively release memory when close() is called
The code still maintains backward compatibility for the case where
close() is never called

Author: mattip <[email protected]>

Closes pandas-dev#15665 from mattip/pypy-compat and squashes the following commits:

eaf50fe [mattip] COMPAT: free parser memory at close() for non-refcnt gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants