Skip to content

perMessageDeflate memory leak #559

Closed

Description

@laino

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.

Activity

  1. storv commented on Jul 26, 2019

    @storv

    mark to ensure resolve this problem

  2. SupertigerDev commented on Aug 24, 2019

    @SupertigerDev

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

  3. darrachequesne commented on Oct 5, 2020

    @darrachequesne
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions