Answer the question
In order to leave comments, you need to log in
Warning for a possible memory leak when running forever-monitor
There is such a thing as forever-monitor - an application for Node.JS that monitors that the process is alive and restarts it if necessary. Works for both nodejs projects and third party programs. The following code (need to keep N workers running all the time):
var forever = require('forever-monitor');
for (var i=1;i<=11;i++) {
forever.start([ '/usr/bin/php', 'worker.php', i ], {
max : Math.Infinity,
silent : false
});
}
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace at WriteStream.EventEmitter.addListener(events.js:175:15) at Socket.Stream.pipe(stream.js:52:8) at startLogs(.../forever-monitor/lib/forever-monitor/plugins/logger.js:65:30) at EventEmitter.emit (.../forever-monitor/node_modules/broadway/node_modules/eventemitter2/lib/eventemitter2.js:332:22) at Monitor.start.child.on.spinning(.../forever-monitor/lib/forever-monitor/monitor.js:153:10) at process.startup.processNextTick.process._tickCallback(node.js:244:9)
Answer the question
In order to leave comments, you need to log in
actually, it's okay - the default EventEmmiter has a limit of 10 listeners, in case objects in the process are subscribed and not unsubscribed (that is, under some conditions this may indicate a leak). Here is such a code. That is, the message is simply displayed, nothing else.
It's in the official documentation .
In short, this message is issued when you have more than 10 event listeners.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question