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

perMessageDeflate memory leak #559

Closed
1 of 2 tasks
laino opened this issue Sep 8, 2018 · 3 comments
Closed
1 of 2 tasks

perMessageDeflate memory leak #559

laino opened this issue Sep 8, 2018 · 3 comments

Comments

@laino
Copy link

laino commented Sep 8, 2018

You want to:

  • report a bug
  • request a feature

Current behaviour

There appears to be some kind of memory leak when using perMessageDeflate: true (default).
It used to be fine, but I suppose a combination of updated dependencies (node/engine.io?) resulted in this leak. It's very noticable when it happens.

With deflate my application will use >3GB of memory (and rising until OOM) with 10-20k active websockets.
Without deflate I'm looking at <1GB. I transfer about 200-300kb of data to each client.

Here's a screenshot of what a heapdump looks like: https://i.imgur.com/byTUInU.png

Expected behaviour

Reasonable memory usage.

Setup

  • OS: Linux
  • engine.io: 3.2.0 and 3.1.5 (probably)
  • node: v10.9.0 and at least some v9.X.X releases

Suggestion

Maybe updating "ws" to a recent version could help fix this. It would be cool if I could provide a wsEngine object directly via the options object, instead of having the require('ws') done internally.

@storv
Copy link

storv commented Jul 26, 2019

mark to ensure resolve this problem

@SupertigerDev
Copy link

I spent multiple days trying to figure out what's happening and I finally found out its "perMessageDeflate".

@darrachequesne
Copy link
Member

perMessageDeflate has been disabled by default in Engine.IO v4, as it consumes a lot of memory.

See also #299

Closed by 078527a.

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

4 participants