-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Memory leak with CallbackRegistry #19474
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
Labels
Milestone
Comments
Looks related to #19345 (comment) as well? |
Sounds like. |
Thanks, please have a go at it :) |
I think that this bug was introduced in 5257c4f when we switch to using normal dicts from |
That's life. My PR provides a bit stronger tests. |
Fixed by #19480. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Here is a report with a possible patch.
Bug report
We had memory leak issue with our library (see silx-kit/silx#3372).
CallbackRegistry
can sometimes not clean up stored weakref from released object.Bug summary
_func_cid_map
is only cleaned up if a callback name if fully empty.We can think of cases where objects are released in order to never make this callback empty.
As result dead weakrefs are still stored in the structure.
Code for reproduction
Expected outcome
We expect
_func_cid_map
to be not bigger than 2.Matplotlib version
Fix
Without thinking much, i did this hotfix.
The text was updated successfully, but these errors were encountered: