Skip to content

Possible memory leak? #518

@mihai-iorga

Description

@mihai-iorga

I am trying for several days to figure out the following error:

Warning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:259:19)
    at Connection.addListener (events.js:275:10)
    at Connection.Readable.on (_stream_readable.js:687:35)
    at Connection.once (events.js:301:8)
    at Connection._send (/opt/push/server/releases/20170202150908/node_modules/http2/lib/protocol/connection.js:356:10)
    at runCallback (timers.js:649:20)
    at tryOnImmediate (timers.js:622:5)
    at processImmediate [as _immediateCallback] (timers.js:594:5)`

After a long period of debugging (not that memory leaks warnings are debug-able), I think I found from where this error is coming from, server is up and no warnings in the last 24 hours.

I have added after this._connection:

this._connection.setMaxListeners(0);

I know this is not the solution (infinite listeners is a bad idea), but I am tired of figuring out what the hell is happening there, maybe a second pair of eyes can see the leak.

GNU/Linux
NodeJS 6.9.4
NPM 3.10.10

I do not have a reproducible code that emits that warning because it happens once every now and then.
If this only happens to me, then my bad, sorry.

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