8000 Reference leak in np.bincount with weights attribute · Issue #6805 · numpy/numpy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Reference leak in np.bincount with weights attribute #6805

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
jaimefrio opened this issue Dec 9, 2015 · 3 comments
8000
Closed

Reference leak in np.bincount with weights attribute #6805

jaimefrio opened this issue Dec 9, 2015 · 3 comments

Comments

@jaimefrio
Copy link
Member

This code should illustrate what's going on

import sys
import numpy as np

intp_refcount = sys.getrefcount(np.dtype(np.intp))
double_refcount = sys.getrefcount(np.dtype(np.double))

for j in range(1000):
    np.bincount([1, 2, 3])

assert intp_refcount == sys.getrefcount(np.dtype(np.intp))
assert double_refcount == sys.getrefcount(np.dtype(np.double))

for j in range(1000):
    np.bincount([1, 2, 3], [4, 5, 6])

assert intp_refcount == sys.getrefcount(np.dtype(np.intp))  # this fails
assert double_refcount == sys.getrefcount(np.dtype(np.double))
@gfyoung
Copy link
Contributor
gfyoung commented Dec 17, 2015

@jaimefrio: Just curious, with your commit, does this mean you can close the issue?

@jaimefrio
Copy link
Member Author

I have code in my fork, see the link above, that fixes the reference counting, but I cannot send a PR until my employer reviews the code and OKs it. Which reminds me that I have to submit the code for review, will do so tomorrow morning.

@gfyoung
Copy link
Contributor
gfyoung commented Dec 17, 2015

Oh, of course! For some reason, I misread the branch as numpy/numpy. Sorry about that!

@seberg seberg closed this as completed in 94a47c5 Mar 22, 2016
seberg added a commit that referenced this issue Mar 22, 2016
BUG: reference count leak in bincount, fixes #6805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0