Answer the question
In order to leave comments, you need to log in
How to prevent Node.js from shutting down due to low memory?
Due to lack of memory, the process I need is disabled
In the log
[2016-08-28 11:12:16] [ERROR] (node) warning: possible EventEmitter memory leak detected. 11 off listeners added. Use emitter.setMaxListeners() to increase limit.
[2016-08-28 11:12:16] [ERROR] Trace
at addListener (events.js:239:17)
at Scales.powerOn (/srv/scales/lib/process.js:399:10)
at Async.series.startup (/srv/scales/lib/process.js:213:18)
at /srv/scales/node_modules/async/lib/async.js:718:13
at iterate (/srv/scales/node_modules/async/lib/async.js:262:13)
at /srv/scales/node_modules/async/lib/async.js:274:29
at /srv/scales/node_modules/async/lib/async.js:44:16
at /srv/scales/node_modules/async/lib/async.js:723:17
at /srv/scales/node_modules/async/lib/async.js:167:37
at /srv/scales/lib/plugins/minecraft/main.js:111:28
Answer the question
In order to leave comments, you need to log in
https://github.com/foreverjs/forever + look for a bug in the code + the node directly suggests the option with "Use emitter.setMaxListeners() to increase limit."
First of all, make sure that listeners do not breed in a cycle or when creating an object / request on a regular basis. When deleting an object/request that hung a listener, don't forget to remove the added callback from the emitter event using removelistener
, set only the used emitter event instance to an increased limit on listeners.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question