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

MaxListenersExceededWarning: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Event name: *. #49

Open
kbdfck opened this issue Jan 29, 2018 · 2 comments

Comments

@kbdfck
Copy link

kbdfck commented Jan 29, 2018

On 8.1.1, at first run of app, this warning appears:
Seems it is about self.once('socket.*', on_error)
When running in trace mode, this is not shown, maybe because of some delay introduced by output?

MaxListenersExceededWarning: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Event name: *.
at FreeSwitchResponse.logPossibleMemoryLeak (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:52:15)
at FreeSwitchResponse.growListenerTree (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:228:35)
at FreeSwitchResponse.EventEmitter._on (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:557:24)
at FreeSwitchResponse.EventEmitter._many (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:295:10)
at FreeSwitchResponse.EventEmitter._once (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:267:10)
at FreeSwitchResponse.EventEmitter.once (/appserver/node_modules/eventemitter2/lib/eventemitter2.js:259:17)
at /appserver/node_modules/esl/lib/response.js:145:14
at Promise.cancellationExecute [as _execute] (/appserver/node_modules/esl/node_modules/bluebird/js/release/debuggability.js:324:9)
at Promise._resolveFromExecutor (/appserver/node_modules/esl/node_modules/bluebird/js/release/promise.js:483:18)
at new Promise (/appserver/node_modules/esl/node_modules/bluebird/js/release/promise.js:79:10)
at FreeSwitchResponse.module.exports.FreeSwitchResponse.onceAsync (/appserver/node_modules/esl/lib/response.js:106:18)
at /appserver/node_modules/esl/lib/response.js:314:21
at /appserver/node_modules/esl/lib/response.js:161:20
at tryCatcher (/appserver/node_modules/esl/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/appserver/node_modules/esl/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/appserver/node_modules/esl/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/appserver/node_modules/esl/node_modules/bluebird/js/release/promise.js:606:10)
at Async._drainQueue (/appserver/node_modules/esl/node_modules/bluebird/js/release/async.js:138:12)
at Async._drainQueues (/appserver/node_modules/esl/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (/appserver/node_modules/esl/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)

@shimaore
Copy link
Owner

If you are using the module in "inbound" event-socket mode (client mode), you need to setMaxListeners to (approximately) the number of concurrent operations you might have at a given time (typically I set it to my expected number of concurrent calls), because the pending operations will consume event listeners:

client.setMaxListeners( 200 );

The default is 11 in Node, but that's an arbitrary value.

@kbdfck
Copy link
Author

kbdfck commented Jan 30, 2018

Yes, I use module as client connecting to FS servers. Thanks for clarification, will give it a try!

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