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 leaks in yjs websocket docs map #145

Open
sbavoma opened this issue Jul 9, 2023 · 1 comment
Open

Memory leaks in yjs websocket docs map #145

sbavoma opened this issue Jul 9, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sbavoma
Copy link

sbavoma commented Jul 9, 2023

I did some profiling on our yjs websocket server and found that there is a memory leak present in there.
Even after the yjs ws session has ended, the library fails to de-reference its Yjs Doc objects leading them to pile up in memory.

After careful debugging I have found that here is the issue - https://github.com/yjs/y-websocket/blob/master/bin/utils.js#L66
Perhaps we should use a weakmap? Is there any way to make sure when we call delete on this map we destroy all references.

@sbavoma sbavoma added the bug Something isn't working label Jul 9, 2023
@jiangxiaoqiang
Copy link

I am facing the same issue.

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

No branches or pull requests

3 participants