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

closeSocketFor does not destroy the web socket and causes memory leak #171

Open
sethphillips opened this issue Jun 19, 2019 · 3 comments
Open

Comments

@sethphillips
Copy link

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.

@cmackenz
Copy link

@sethphillips how are you destroying the proxyObject?

@sethphillips
Copy link
Author

sethphillips commented Aug 31, 2020

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()

@cmackenz
Copy link

@sethphillips thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants