Node.js · Middle · Question 22 of 75
What does the warning MaxListenersExceededWarning usually point to?
- 1There are too many emitters in the app
- ✓Correct answer: A likely memory leak: listeners are added again and again (for example, on every request) and never removed
- 3An emitter received too many events per second
Explanation
The default limit is 10 listeners per event. Raising it with setMaxListeners hides the problem; usually you should remove listeners with off or use once.