Hello! I hope I get can some help in solving this problem I have with Node-Red!
Up till 3 weeks ago, I was running Node-Red V0.2.x perfectly on my Raspberry Pi4 without any problems.
However, after that, the terminal I use to run Node-Red started giving me MaxListenersExceededWarning: Possible EventEmitter memory leak detected.
errors.
Naturally, I looked up the error and many forums stated it's just a warning so I wasn't too concerned.
Around 2 weeks back, as I was using Node-Red, the web page would start losing connection to the server, and when I checked the terminal again it would give me these errors with different Node IDs every time.
Welcome to Node-RED
===================
2 Dec 10:19:16 - [info] Node-RED version: v1.0.3
2 Dec 10:19:16 - [info] Node.js version: v12.13.1
2 Dec 10:19:16 - [info] Linux 4.19.75-v7l+ arm LE
2 Dec 10:19:16 - [info] Loading palette nodes
2 Dec 10:19:18 - [info] Dashboard version 2.18.0 started at /ui
2 Dec 10:19:18 - [info] Settings file : /home/pi/.node-red/settings.js
2 Dec 10:19:18 - [info] Context store : 'default' [module=memory]
2 Dec 10:19:18 - [info] User directory : /home/pi/.node-red
2 Dec 10:19:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
2 Dec 10:19:18 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
2 Dec 10:19:18 - [info] Server now running at http://127.0.0.1:1880/
2 Dec 10:19:18 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
2 Dec 10:19:18 - [info] Starting flows
2 Dec 10:19:18 - [info] Started flows
(node:2431) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [Firmata]. Use emitter.setMaxListeners() to increase limit
(node:2431) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [Firmata]. Use emitter.setMaxListeners() to increase limit
(node:2431) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [Firmata]. Use emitter.setMaxListeners() to increase limit
<--- Last few GCs --->
[2431:0x1fbc620] 119748 ms: Scavenge 253.9 (257.2) -> 252.5 (261.4) MB, 12.3 / 0.0 ms (average mu = 0.295, current mu = 0.287) allocation failure
[2431:0x1fbc620] 121826 ms: Mark-sweep 253.6 (261.4) -> 253.4 (255.9) MB, 1339.2 / 0.1 ms (+ 591.2 ms in 1272 steps since start of marking, biggest step 7.5 ms, walltime since start of marking 2078 ms) (average mu = 0.249, current mu = 0.194) finalize
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
nodered.service: Main process exited, code=killed, status=6/ABRT
nodered.service: Failed with result 'signal'.
nodered.service: Service RestartSec=100ms expired, scheduling restart.
nodered.service: Scheduled restart job, restart counter is at 10.
Stopped Node-RED graphical event wiring tool.
Started Node-RED graphical event wiring tool.
Updating Nodejs, NPM and Node-red did nothing.
I tried using the max_old_space_size command but that didn't work too.
I believe it's not a problem with the version but one of the nodes ( I suspect the Arduino nodes).
Here's a picture of my nodes.
How do I solve this issue? Thank you!!