Node red stops running after some hours

Hello,

I am using node red v1.1.3 , running on pc,
plc: simatic et 200sp,
communication: OPC UA protocol
I am reading data and trying to write data from plc (which is not possible till now).

  1. But, node-red stops after random intervals
  2. Read is possible, write is not happening,
    I am trying opc ua write node, same used in read, trying to reset a bit which is defined in plc program
    I have tested writing with OPC UA assistant, it works

I am new to node red, any help would be appreciable.

Vishal Kaushik

What exactly do you mean by that? Do you mean node-red crashes or do you just mean that some part of the flow stops working?
If you mean it is crashing then start node red in a terminal and run till it crashes then show us what appears in the terminal when it crashes.
If you mean some part of the flow stops doing anything then add debug nodes at appropriate places so you can see what in the flow has stopped.

Are your points 1 and 2 separate problems? If so then probably better not to try and ask them both in one question, the thread will just get confused about which point is being addressed. So maybe start a new thread for the write problem.

1 Like

I assume your machine doesn't go into sleep mode after an amount of time (or hibernate?)

1 Like

Hello ,
Thanks for the reply, the issue is , node red shows server lost the connection, node red stops and then node red had to be restarted from the terminaI,I will check terminal for error next time it stop and I will upload the error in the thread.

Regarding hibernate mode: I kept the node red running with pc in hibernate mode. yes, but how can it runs for some hours and then stops in hibernate.

Which connection from/to where? I assume from Node-RED to the PLC?

You need to share more information - for example what PLC? How is it configured? What kind of connection is it?

1 Like

Good point, I assumed that @vishalk meant that the browser is losing connection to the node-red server, but perhaps that is not what was meant.

1 Like

Not sure if this is the case but let me tell you wahat I have seen.

I run NR on a Pi My main computer is a Mac so I open a terminal session on the Mac and ssh to the PI. There I start NR with node-red. This starts Node-RED on the pi and as long as my Mac is active, everything is fine. However, when My mac goes to sleep, the terminal session disconnects from the Pi which causes the session on the Pi to end and node-red stops.

The way around this is to start NR as a service or using theh command node-red-start and NR will continue running.

You could also use something like screen so that your SSH shell stays active and can be reconnected to. Generally though it is much better to use systemd to manage Node-RED. If you need to you can still leave Node-RED off and just turn it on when you want it, systemd doesn't have to start all services at bootup.

2 Likes

Hello,

Thank you every one,
Now, after 16 hours of running, Node red stoped with error below,pc dont go into sleep.


Running Node red on my pc : 8 gb ram,core i7-6700, processor 3.40ghz , windows 10 enterpise.
I am using 2 opc ua read node for two controller (simatic plc, sinumerik) , 20 variable reading in total, 10 sample/seconds.

My typical flow looks like this

@samos dont go into sleep

@zenofmud
node-red-start command dont work, with this node red dont start, I am running node red on my pc, 16 gb ram. I have posted the error too. please have a look. PC dont go to sleep.

The error says you have run out of memory.
When posting logs, code or flows please copy/paste rather than taking a photo, if possible. Use the </> button at the top of the forum text entry window when pasting it in.
What OS are you running on and how did you install node-red?
Start node-red in a terminal and copy/paste the output here please.

1 Like

As @Colin noted, you have run out of memory. I notice, in the image of your flow, you have many graphs. How many points are you displaying on each graph. Displaying too many points can cause performance issues and running out of memory could occur.

1 Like

@Colin
running on windows 10 enterprise
1.node red installation on pc with:

npm install -g --unsafe-perm node-red

updated node with :

npm install -g --unsafe-perm node-red

Here is one flow

[{"id":"960a8614.c0d5a8","type":"tab","label":"Achspos Sinumerik","disabled":false,"info":""},{"id":"c06dcfba.330e","type":"comment","z":"960a8614.c0d5a8","name":"","info":"CPO$pwd$4$at","x":240,"y":200,"wires":[]},{"id":"9e3dc55c.256ff8","type":"switch","z":"960a8614.c0d5a8","name":"divide output","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[21]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[22]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[23]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[24]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[25]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[26]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[27]","vt":"str"},{"t":"eq","v":"ns=2;s=/Nck/MachineAxis/measPos1[28]","vt":"str"},{"t":"eq","v":"ns=2;s=/NC/_N_NC_GD3_ACX/_MAINLOOP","vt":"str"}],"checkall":"true","repair":false,"outputs":9,"x":590,"y":560,"wires":[["3c570517.0c0aba","efaf461.0b53bb8","c44b356.bc60ac8"],["642a63d3.3c8f0c","51477b24.f74ef4","c3f31124.67f02"],["81f26212.2cf2a","4223403b.fb9e2","cfdb0d23.46768"],["df61a9a6.b40558","b486d2a3.08bc8","371d5e49.bbbc82"],["7307bedf.b7088","1442ea43.583dd6"],["f299d8be.0c99f8","5c41b5f9.af793c","e207bb2e.9137d8"],["8aa92816.e373d8","f45c3b78.ca2568","7b9dff5d.93431"],["2c099aa9.46a2d6","da996ce5.2ed33","8f4bb02e.14256"],["f36e69bb.62e478","bb37dd37.3a91f"]]},{"id":"cfdb0d23.46768","type":"debug","z":"960a8614.c0d5a8","name":"p3","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1010,"y":520,"wires":[]},{"id":"c3f31124.67f02","type":"debug","z":"960a8614.c0d5a8","name":"p2","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":460,"wires":[]},{"id":"df61a9a6.b40558","type":"debug","z":"960a8614.c0d5a8","name":"p4","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1070,"y":580,"wires":[]},{"id":"7307bedf.b7088","type":"debug","z":"960a8614.c0d5a8","name":"p5","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1110,"y":620,"wires":[]},{"id":"f299d8be.0c99f8","type":"debug","z":"960a8614.c0d5a8","name":"p6","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1050,"y":660,"wires":[]},{"id":"8aa92816.e373d8","type":"debug","z":"960a8614.c0d5a8","name":"p7","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":700,"wires":[]},{"id":"2c099aa9.46a2d6","type":"debug","z":"960a8614.c0d5a8","name":"p8","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":760,"wires":[]},{"id":"c44b356.bc60ac8","type":"debug","z":"960a8614.c0d5a8","name":"p1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":930,"y":360,"wires":[]},{"id":"bb37dd37.3a91f","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1110,"y":820,"wires":[]},{"id":"3c570517.0c0aba","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":18,"width":0,"height":0,"name":"Pos1[21]","label":"Pos1[21]","format":"{{msg.payload}}","layout":"row-spread","x":740,"y":740,"wires":[]},{"id":"642a63d3.3c8f0c","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":1,"width":0,"height":0,"name":"Pos1[22]","label":"Pos1[22]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":800,"wires":[]},{"id":"81f26212.2cf2a","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":2,"width":0,"height":0,"name":"Pos1[23]","label":"Pos1[23]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":840,"wires":[]},{"id":"b486d2a3.08bc8","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":3,"width":0,"height":0,"name":"Pos1[24]","label":"Pos1[24]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":880,"wires":[]},{"id":"1442ea43.583dd6","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":4,"width":0,"height":0,"name":"Pos1[25]","label":"Pos1[25]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":920,"wires":[]},{"id":"5c41b5f9.af793c","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":5,"width":0,"height":0,"name":"Pos1[26]","label":"Pos1[26]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":960,"wires":[]},{"id":"f45c3b78.ca2568","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":6,"width":0,"height":0,"name":"Pos1[27]","label":"Pos1[27]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":1000,"wires":[]},{"id":"da996ce5.2ed33","type":"ui_text","z":"960a8614.c0d5a8","group":"6217eeca.2a231","order":7,"width":0,"height":0,"name":"Pos1[28]","label":"Pos1[28]","format":"{{msg.payload}}","layout":"row-spread","x":730,"y":1040,"wires":[]},{"id":"f36e69bb.62e478","type":"ui_gauge","z":"960a8614.c0d5a8","name":"mainloop","group":"6217eeca.2a231","order":8,"width":0,"height":0,"gtype":"gage","title":"mainloop","label":"units","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":870,"y":920,"wires":[],"inputLabels":["mainloop"]},{"id":"cd99a5c9.0fcef8","type":"OpcUa-Client","z":"960a8614.c0d5a8","endpoint":"95d2f56b.7b45f8","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","securitymode":"None","securitypolicy":"None","name":"","x":380,"y":480,"wires":[["9e3dc55c.256ff8","e5e337cc.6ab2e8"]]},{"id":"efaf461.0b53bb8","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos1","measurement":"Pos1","precision":"","retentionPolicy":"","x":610,"y":60,"wires":[]},{"id":"51477b24.f74ef4","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos2","measurement":"Pos2","precision":"ms","retentionPolicy":"","x":630,"y":120,"wires":[]},{"id":"4223403b.fb9e2","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos3","measurement":"Pos3","precision":"","retentionPolicy":"","x":630,"y":160,"wires":[]},{"id":"371d5e49.bbbc82","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos4","measurement":"Pos4","precision":"","retentionPolicy":"","x":620,"y":200,"wires":[]},{"id":"e207bb2e.9137d8","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos6","measurement":"Pos6","precision":"","retentionPolicy":"","x":620,"y":240,"wires":[]},{"id":"7b9dff5d.93431","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos7","measurement":"Pos7","precision":"","retentionPolicy":"","x":630,"y":280,"wires":[]},{"id":"8f4bb02e.14256","type":"influxdb out","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","name":"Pos8","measurement":"Pos8","precision":"","retentionPolicy":"","x":730,"y":340,"wires":[]},{"id":"67388528.7627ac","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos1[21],datatype=Double","payload":"","payloadType":"date","x":130,"y":360,"wires":[["a7eb046d.7da458"]]},{"id":"2450d399.22d48c","type":"function","z":"960a8614.c0d5a8","name":"","func":"return [\n [\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[21],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[22],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[23],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[24],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[25],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[26],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[27],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/Nck/MachineAxis/measPos1[28],datatype=Double\", payload: \"timestamp\"},\n   { topic: \"ns=2;s=/NC/_N_NC_GD3_ACX/_MAINLOOP,datatype=Int32\", payload: \"timestamp\"},\n  ]\n]\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":100,"wires":[["cd99a5c9.0fcef8"]]},{"id":"115998a8.3d1cc7","type":"influxdb batch","z":"960a8614.c0d5a8","influxdb":"1fdf23cd.bd843c","precision":"ms","retentionPolicy":"","name":"Pos1","x":730,"y":60,"wires":[]},{"id":"4f3bbd0e.e2e734","type":"inject","z":"960a8614.c0d5a8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos2,datatype=Double","payload":"","payloadType":"date","x":110,"y":720,"wires":[["90faebc.d8c9318"]]},{"id":"90faebc.d8c9318","type":"OpcUa-Client","z":"960a8614.c0d5a8","d":true,"endpoint":"95d2f56b.7b45f8","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","securitymode":"None","securitypolicy":"None","name":"","x":320,"y":740,"wires":[["40fae6a5.222e98"]]},{"id":"40fae6a5.222e98","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":530,"y":740,"wires":[]},{"id":"36e384a9.c77a2c","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos1[22],datatype=Double","payload":"","payloadType":"date","x":130,"y":420,"wires":[["a7eb046d.7da458"]]},{"id":"79dd14f6.2de6bc","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos1[23],datatype=Double","payload":"","payloadType":"date","x":130,"y":480,"wires":[["a7eb046d.7da458"]]},{"id":"a7eb046d.7da458","type":"join","z":"960a8614.c0d5a8","name":"","mode":"custom","build":"object","property":"","propertyType":"full","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"5","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":350,"y":300,"wires":[["cc81c53a.f24838"]]},{"id":"cc81c53a.f24838","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":450,"y":420,"wires":[]},{"id":"ed228810.86f088","type":"function","z":"960a8614.c0d5a8","name":"","func":"var msg111 = {};\nvar msg211 = {};\nvar msg311 = {};\n\n\nmsg111.payload = msg.payload[0];\nmsg111.topic = \"Widerstand1\";\nmsg211.payload = msg.payload[1];\nmsg211.topic = \"Widerstand2\";\nmsg311.payload = msg.payload[2];\nmsg311.topic = \"Widerstand3\";\n\n\nreturn [msg111, msg211, msg311];","outputs":8,"noerr":0,"initialize":"","finalize":"","x":840,"y":160,"wires":[["6148233a.86162c"],["cd62817a.a4d0f"],["9bb10c9b.d8679"],["8ead8185.258dc"],["7be2e72f.feedb8"],[],[],[]]},{"id":"6148233a.86162c","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1060,"y":60,"wires":[]},{"id":"cd62817a.a4d0f","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1070,"y":120,"wires":[]},{"id":"9bb10c9b.d8679","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1070,"y":180,"wires":[]},{"id":"5b59a0d6.cbdfc","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":80,"wires":[["2450d399.22d48c"]]},{"id":"2534f8b1.845f88","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos1[24],datatype=Double","payload":"","payloadType":"date","x":110,"y":540,"wires":[["a7eb046d.7da458"]]},{"id":"3d6189e8.048d66","type":"inject","z":"960a8614.c0d5a8","name":"Start Sinumerik ","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"20","crontab":"","once":false,"onceDelay":0.1,"topic":"ns=2;s=/Nck/MachineAxis/measPos1[25],datatype=Double","payload":"","payloadType":"date","x":110,"y":600,"wires":[["a7eb046d.7da458"]]},{"id":"8ead8185.258dc","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":240,"wires":[]},{"id":"7be2e72f.feedb8","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1090,"y":300,"wires":[]},{"id":"e5e337cc.6ab2e8","type":"debug","z":"960a8614.c0d5a8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":410,"y":680,"wires":[]},{"id":"f4f9162.2c990e8","type":"mqtt out","z":"960a8614.c0d5a8","name":"","topic":"demo","qos":"","retain":"","broker":"5973a8a3.e12758","x":910,"y":300,"wires":[]},{"id":"6217eeca.2a231","type":"ui_group","name":"Group 1","tab":"39afc967.757636","order":1,"disp":true,"width":6},{"id":"95d2f56b.7b45f8","type":"OpcUa-Endpoint","z":"","endpoint":"opc.tcp://10.1.1.200:4840","secpol":"None","secmode":"None","login":true},{"id":"1fdf23cd.bd843c","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"TESTING","name":"Pos1","usetls":false,"tls":""},{"id":"5973a8a3.e12758","type":"mqtt-broker","z":"","name":"neww","broker":"a3felp1eneo5qp-ats.iot.eu-west-1.amazonaws.com","port":"8883","tls":"b47a43.b63ac5c","clientid":"","usetls":true,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"39afc967.757636","type":"ui_tab","z":"","name":"sinumerik","icon":"dashboard","order":3,"disabled":false,"hidden":false},{"id":"b47a43.b63ac5c","type":"tls-config","z":"","name":"xyz","cert":"Downloads\\dd7f3a627a-certificate.pem.crt","key":"Downloads\\dd7f3a627a-private.pem.key","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":true}]

sorry for posting picture of console , I again restarted the node red,
Now,I am deleting extra unnecessary charts.

Another flow I am using is

[{"id":"cd99a5c9.0fcef8","type":"OpcUa-Client","z":"960a8614.c0d5a8","endpoint":"95d2f56b.7b45f8","action":"read","deadbandtype":"a","deadbandvalue":1,"time":10,"timeUnit":"s","certificate":"n","localfile":"","securitymode":"None","securitypolicy":"None","name":"","x":380,"y":480,"wires":[["9e3dc55c.256ff8","e5e337cc.6ab2e8"]]},{"id":"95d2f56b.7b45f8","type":"OpcUa-Endpoint","z":"","endpoint":"","secpol":"None","secmode":"None","login":true}]

@zenofmud
Thanks for reply .Now,I am deleting extra unnecessary charts and I will run node red.

You have to go to a new line before clicking the </> button, I will correct your previous post so I can import the flow

1 Like

I was going to look at the chart config, but I see you have removed them all so I can't check. If you have not charts at all and it still fails then obviously it isn't that.

Run top on the server and leave it running to see whether it is showing anything over a period. 8GB is a hell of a lot of memory to use up.

1 Like

Dashboard charts will slow the browser down but unlikely to cause a heap error. That is caused by Node.js's garbage collection process being unable to allocate a sufficient block of heap. It generally indicates a memory leak somewhere. That can be caused by a node failing to release variables correctly or by something in your flow accumulating large amounts of data into the msg or a global/flow/context variable.

I would firstly check all of your variables to see if you have anything growing too big. But after that, you've not many choices but to dig into how to debug Node.js services.

In regard to having 8GB, Node.js will not necessarily have access to all of that of course. If you want to check what Node-RED is getting for its heap, you can add something like the following to the start of your settings.js file:

const v8 = require('v8');
const totalHeapSize = v8.getHeapStatistics().total_available_size;
let totalHeapSizaInMB = (totalHeapSize / 1024 / 1024).toFixed(2)

console.log("V8 Total Heap Size", totalHeapSizaInMB, "MB");

It is Windows, it doesn't have top, it has its own monitor. :slight_smile:

1 Like

True, I was confused by one of the posts talking about running on a pi.