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

possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit. #206

Open
bernex opened this issue Jun 30, 2016 · 2 comments

Comments

@bernex
Copy link

bernex commented Jun 30, 2016

Hi, how I can fix it?

(node) warning: possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at TLSSocket.addListener (events.js:239:17)
    at TLSSocket.Readable.on (_stream_readable.js:665:33)
    at first (c:\Folders\Sand\koa2-kickstarter\node_modules\ee-first\index.js:43:10)
    at onSocket (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:114:16)
    at attachFinishedListener (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:119:5)
    at attachListener (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:146:5)
    at onFinished (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:52:3)
    at Server.<anonymous> (c:\Folders\Sand\koa2-kickstarter\node_modules\koa\lib\application.js:134:7)
    at emitTwo (events.js:87:13)
    at Server.emit (events.js:172:7)
(node) warning: possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at TLSSocket.addListener (events.js:239:17)
    at TLSSocket.Readable.on (_stream_readable.js:665:33)
    at first (c:\Folders\Sand\koa2-kickstarter\node_modules\ee-first\index.js:43:10)
    at onSocket (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:114:16)
    at attachFinishedListener (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:119:5)
    at attachListener (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:146:5)
    at onFinished (c:\Folders\Sand\koa2-kickstarter\node_modules\on-finished\index.js:52:3)
    at Server.<anonymous> (c:\Folders\Sand\koa2-kickstarter\node_modules\koa\lib\application.js:134:7)
    at emitTwo (events.js:87:13)
    at Server.emit (events.js:172:7)
@akc42
Copy link
Contributor

akc42 commented Jun 30, 2016

I get this too. I though at first it was related to using push, where I sent a lot of files one after the other (about 40) but it has nothing to do with it, as it still occurs soon after I start my application up.

I have no idea if this is a slow leak or just going over the limit slightly, as the warning is only produced once of each event and then is never repeated.

@akc42
Copy link
Contributor

akc42 commented May 12, 2017

I discovered what this was and its NOT a memory leak. Its the way serve-static handles streams. I've actually just raised this as an issue against that repository
expressjs/serve-static#87

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