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 Leak #869

Closed
lawlmart opened this issue Oct 20, 2016 · 9 comments
Closed

Memory Leak #869

lawlmart opened this issue Oct 20, 2016 · 9 comments

Comments

@lawlmart
Copy link

I've trying to track down a memory leak that seems to be related to ws. My socket server has ~ 300 connections per second and peaks out at around 15000 concurrents before running out of memory (8 gb). Memory usage seems to rise linearly (proportional to new connections, not concurrent connections). Here's what I believe to be the relevant part of the heap dump:

image

Thanks in advance for your assistance.

@lpinca
Copy link
Member

lpinca commented Oct 21, 2016

Can you try to disable the permessage-deflate extension?
Possible duplicate of #804.

@lawlmart
Copy link
Author

lawlmart commented Oct 21, 2016

Yes, same result just without the deflate calls in the stack.

I also checked gc and it appeared to be running fine, but I don't have much experience debugging this sort of thing.

@lpinca
Copy link
Member

lpinca commented Oct 21, 2016

I'm kinda new to ws codebase so I'm not sure where to look.
Did you also try to disable client tracking?
Is it possible to reproduce the issue somehow?
Thanks.

@schwiet
Copy link

schwiet commented Jan 12, 2017

I too wonder if it has to do with client tracking, which does not seem to work for me, at least when a client has disconnected. If I print wss.clients.length each 'connection' event and then again each time a client hits onclose, I see something like:


client connected:  1 clients
client disconnected. 1 clients

client connected:  2 clients
client disconnected. 2 clients

client connected:  3 clients
client disconnected. 3 clients

client connected:  4 clients
client disconnected. 4 clients

client connected:  5 clients
client disconnected. 5 clients

client connected:  6 clients
client disconnected. 6 clients

Looks like clients are not removed upon disconnection, which seems like it would be the expected behavior, right?

@schwiet
Copy link

schwiet commented Jan 12, 2017

#967 possibly related.

@lpinca
Copy link
Member

lpinca commented Jan 27, 2017

@lawlmart were you using ws.onclose = function () {}; on the server?

@lawlmart
Copy link
Author

No, I'm not.

@lpinca
Copy link
Member

lpinca commented Jan 27, 2017

Can you try with ws@beta and see if the issue persists? Also disable permessage-deflate if you can.

Thanks.

@lpinca
Copy link
Member

lpinca commented Apr 28, 2017

Closing as I can't reproduce the issue. Please post back if you have more info.
Thanks.

@lpinca lpinca closed this as completed Apr 28, 2017
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

3 participants