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
Unbounded memory use when specifying otypes='d' in vectorize. #11867
Comments
Are you sure there is no leak with your fix? When I tried a test with
Still playing with it to understand where the extra reference(s) is being created. Adding |
You're right, the memory usage still grows, just more slowly. I added one def main3():
while True:
m = myclass()
m.f_class_method_vec_d(0)
del m.f_class_method_vec_d._ufunc
del m.f_class_method_vec_d # added this del |
|
Oops, forgot to add/keep a fixes to the commit. This was closed by gh-11977 |
@nadiahpk first encountered this in the way that SciPy's
hypergeom
uses vectorize.Here is a stand-alone example for reproducing the memory behaviour:
I believe the issue is that
self._ufunc
becomes a circular reference when the function being vectorized is a class method.I have a workaround here: carlohamalainen@9b5747b
The text was updated successfully, but these errors were encountered: