emitter.setMaxListeners() in node.js

950 views
Skip to first unread message

Walter Kraembring

unread,
Sep 23, 2016, 2:38:53 AM9/23/16
to Node-RED
After updating using update-nodejs-and-nodered I receive the following in the log

(node) warning: possible EventEmitter memory leak detected. 11 closed listeners added. Use emitter.setMaxListeners() to increase limit.


I have understood that I have more than 10 listeners to event and this is a node.js setting that needs to be changed. How can I set a setting in node.js to increase the number of listeners?

Best regards, Walter

Nicholas O'Leary

unread,
Sep 23, 2016, 2:44:18 AM9/23/16
to Node-RED

That has to be addressed by the individual nodes that are using their own EventEmitter.

In your flow, what nodes do you have more than 10 of?

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/e2c2c0c5-7428-4b7c-9f57-d539e3a10102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Walter Kraembring

unread,
Sep 23, 2016, 7:55:28 AM9/23/16
to Node-RED
I have many nodes more than x10 times in the flow like function nodes,, bigtimers, mqtt in & out nodes, rfxcom nodes etc but I have never seen this error message before, the flow seems to work anyway

The complete error from log is as below (websocket is indicated as first). I will next try to reboot the Pi and see if this helps

Thanks 


(node) warning: possible EventEmitter memory leak detected. 11 opened listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at WebSocketListenerNode.addListener (events.js:239:17)
at WebSocketListenerNode.Node.on (/usr/lib/node_modules/node-red/red/runtime/nodes/Node.js:80:14)
at new WebSocketInNode (/usr/lib/node_modules/node-red/nodes/core/io/22-websocket.js:200:31)
at createNode (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:302:18)
at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:87:35)
at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:264:29)
at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30)
at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4)
at Fulfilled.when (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:592:4)
at Pending.run (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:483:13)
at Scheduler._drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:62:19)
at Scheduler.drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:27:9)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)


 

Nicholas O'Leary

unread,
Sep 23, 2016, 7:57:51 AM9/23/16
to Node-RED

That stack is sufficient to spot the culprit - thanks.

It is just a warning of a potential leak... but it is a false positive in this instance. Nothing to be concerned by.

Nick


--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Walter Kraembring

unread,
Sep 23, 2016, 8:42:38 AM9/23/16
to Node-RED
I thank you very much!

Good to know,

Have a nice weekend,
Walter
Reply all
Reply to author
Forward
0 new messages