Open jiangxiaoqiang opened 8 months ago
The y-websocket server keeps all documents around forever, unless you specify a persistence provider (like y-leveldb). Is that what's happening?
The y-websocket server keeps all documents around forever, unless you specify a persistence provider (like y-leveldb). Is that what's happening?
I have already specify the leveldb and I also checked the level db only have 5MB. load the full db may not take so much memory.
the destroy function are just create a new map? I am confused with this:
if (doc.conns.size === 0 && persistence !== null) {
// if persisted, we store state and destroy ydocument
persistence.writeState(doc.name, doc).then(() => {
doc.destroy()
})
docs.delete(doc.name)
}
this is the destroy implement:
destroy () {
this._observers = map.create()
}
Describe the bug
the y-websocket always restart automatically(I am deployment this application in kubernetes pod), I am using the grafana to monitor the y-websocket memory, now I found the momory are increase suddenly and there is no new connection to y-websoket. My document is small(less than 1MB).
Expected behavior
The momory could back to normal.
Screenshots
Environment Information
I tried to dump the memory and found there have 50000+ map take 68% memory like this:
this is the level db file size:
I have tried to diff the dump, somewhere map in the y-websocket did not release. this issue was look like the same with https://github.com/yjs/y-websocket/issues/145