Skip to content

Memory leaks in yjs websocket docs map #145

Open
@sbavoma

Description

@sbavoma

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions