The EventEmitter class logs this warning when there are more than the 10
listeners subscribed to an event. The number is configurable, with 10 as
the default. You are seeing 11 because it was the eleventh listener being
added that triggered the warning.

The warning is meant to warn you in case you are attaching event handlers
to objects that you are no longer using. In cases like that, the event
handler will be referenced by the EventEmitter instance and therefore won't
get garbage collected. This would potentially be a memory leak, depending
on the nature of the app.

You can safely increase the limit if you know your app just happens to use
lots of concurrent event handlers, but you should also make sure you aren't
leaking memory as a result. Remember that if your event handler is a
closure, that will retain references to everything in the closure, which
means they can't be garbage collected.

See
https://nodejs.org/dist/latest-v4.x/docs/api/events.html#events_emitter_setmaxlisteners_n

~Ryan

On Sun, Sep 4, 2016, 7:30 AM Naveen Kumar Chittipolu <[email protected]>
wrote:

> What is the count *'11' *here? am I adding 11 message listeners? or it is
> the default number which is shown here?
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/165e54ec-8d8a-4a66-b965-4582e07f0597%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/165e54ec-8d8a-4a66-b965-4582e07f0597%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 

~Ryan

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAGjmZGzOpPGFL5C4azPz-VkCtrjU8rBaiNEgqSW2WVTPkpW2%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to