ember-websockets
ember-websockets copied to clipboard
closeSocketFor does not destroy the web socket and causes memory leak
we tracked down a memory leak in our application that led us to sockets hanging around. turns out that the delete get(this, 'sockets')[cleanedUrl];
removes the reference but does not destroy the proxyObject. Getting that socket proxyObject and calling destroy()
on it does remove it from memory though.
Happy to submit a PR if you need.
@sethphillips how are you destroying the proxyObject
?
the proxyObject is returned from the socketFor method on the service.
@service websockets;
//...... random code
let socket = this.websockets.socketFor(someurl);
//...... random code
socket.destroy()
@sethphillips thanks!