Skip to content
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

Memory Leak in Client #125

Closed
garvenlee opened this issue Sep 20, 2023 · 2 comments · Fixed by #129
Closed

Memory Leak in Client #125

garvenlee opened this issue Sep 20, 2023 · 2 comments · Fixed by #129
Labels
bug Something isn't working

Comments

@garvenlee
Copy link

garvenlee commented Sep 20, 2023

The implementation of Client.waiters is a defaultdict(set), each waiter will only be poped out from the set when it completes, while the underlying set will still occupy memory. Similarly, within the _listener task, after a frame is read, defaultdict creates a set internally when calling waiters[key] with the key not in waiters, which is useless but has not been cleaned up.

@garvenlee
Copy link
Author

garvenlee commented Sep 20, 2023

And why needs a set factory in defaultdict ?

@qweeze
Copy link
Collaborator

qweeze commented Sep 21, 2023

Thanks @garvenlee! Yep, that's a bug. Submitted a fix #129

@DanielePalaia DanielePalaia added the bug Something isn't working label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants