# Node red stops running after some hours

**URL:** <https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490>\
**Category:** General\
**Created:** [19 October 2020 09:31 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490 "2020-10-19T09:31:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [19 October 2020 09:31 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/1 "2020-10-19T09:31:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 October 2020 10:26 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/2 "2020-10-19T10:26:53Z")

</div>

> [@vishalk](#):
>
> node-red stops after random intervals

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.

---

<div class="post-metadata">

**Author:** ![samos](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samos](https://discourse.nodered.org/u/samos)\
**Post date:** [19 October 2020 10:47 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/3 "2020-10-19T10:47:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [19 October 2020 10:53 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/4 "2020-10-19T10:53:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 October 2020 13:21 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/5 "2020-10-19T13:21:52Z")

</div>

> [@vishalk](#):
>
> node red shows server lost the connection

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?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [19 October 2020 15:02 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/6 "2020-10-19T15:02:30Z")

</div>

> [@TotallyInformation](#):
>
> Which connection from/to where? I assume from Node-RED to the PLC?

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [19 October 2020 21:40 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/7 "2020-10-19T21:40:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 October 2020 11:17 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/8 "2020-10-20T11:17:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [21 October 2020 08:12 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/9 "2020-10-21T08:12:35Z")

</div>

Hello,

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/9/b93a5736650e74f421826806fa28664afc2086ae.jpeg)  
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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d53116401c5577da4777eaf31eb7bcb4905ebd71.png)

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [21 October 2020 08:13 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/10 "2020-10-21T08:13:38Z")

</div>

@samos dont go into sleep

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [21 October 2020 08:24 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/11 "2020-10-21T08:24:27Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2020 08:28 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/12 "2020-10-21T08:28:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 October 2020 08:48 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/13 "2020-10-21T08:48:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [21 October 2020 09:19 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/14 "2020-10-21T09:19:08Z")

</div>

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

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

```

updated node with :

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

```

Here is one flow

```auto
[{"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

```auto
[{"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}]

```

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://discourse.nodered.org/u/vishalk)\
**Post date:** [21 October 2020 09:21 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/15 "2020-10-21T09:21:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2020 09:33 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/16 "2020-10-21T09:33:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2020 11:28 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/17 "2020-10-21T11:28:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [21 October 2020 14:02 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/18 "2020-10-21T14:02:37Z")

</div>

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:

```auto
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");

```

> [@Colin](#):
>
> Run top on the server

It is Windows, it doesn't have `top`, it has its own monitor. 🙂

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 October 2020 14:47 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/19 "2020-10-21T14:47:36Z")

</div>

> [@TotallyInformation](#):
>
> It is Windows,

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 December 2020 14:47 UTC](https://discourse.nodered.org/t/node-red-stops-running-after-some-hours/34490/20 "2020-12-20T14:47:44Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
