# Node red flow frequently stopped

**URL:** <https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961>\
**Category:** General\
**Created:** [17 March 2022 01:14 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961 "2022-03-17T01:14:31Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![TROJAN053](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@TROJAN053](https://discourse.nodered.org/u/TROJAN053)\
**Post date:** [17 March 2022 01:14 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/1 "2022-03-17T01:14:31Z")

</div>

HI,  
My Node flows are stopped frequently showing error for javaScript heap out of memory.  
Screenshot attached.  
What could be the possible reason any ideas!!!.

 ![JS error](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bc42ef89a81a179d1a9a51b33f39526ee5a12ce4.jpeg)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 March 2022 04:14 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/2 "2022-03-17T04:14:18Z")

</div>

You may need to share more information:

What computer / O/S?  
How much memory does the machine have?

---

<div class="post-metadata">

**Author:** ![TROJAN053](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@TROJAN053](https://discourse.nodered.org/u/TROJAN053)\
**Post date:** [17 March 2022 04:37 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/3 "2022-03-17T04:37:34Z")

</div>

I am using a windows 10 system which having 8gb of RAM . Also, i have observed that particular behavior only happens when i run dashboard on node red.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 March 2022 04:51 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/4 "2022-03-17T04:51:48Z")

</div>

Maybe more _sheep_ (Ram)?

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [17 March 2022 05:59 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/5 "2022-03-17T05:59:47Z")

</div>

I suspect some sort of memory leak in your flows, so the NodeJS garbage collector can't find any candidates to clean up.

How much RAM is your Node-RED instance using when those messages occur?

---

<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:** [17 March 2022 09:27 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/6 "2022-03-17T09:27:54Z")

</div>

Tell us about what you have on the dashboard and how often you are updating the data on the dashboard.  
If you are running charts then tell us the configuration of the charts, how often you are adding data, how many lines there are and what time scale they are configured for.

---

<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:** [17 March 2022 09:29 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/7 "2022-03-17T09:29:00Z")

</div>

> [@Trying\_to\_learn](#):
>
> Maybe more _sheep_ (Ram)?

8GB is a vast amount of memory. There is no way that node-red can consume that much under normal circumstances unless the OP is handling video files, or something like that.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [17 March 2022 23:10 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/8 "2022-03-17T23:10:00Z")

</div>

I am not wanting to argue about _what_ is a vast amount of memory.

64k was a vast amount of memory _way back_.

**WINDOZE** (10).... 8 GB is the bare minimum to run.  
I do have a machine that runs it but it has 32 GB.... And I don't have NR on it so I can't really say.

So I am offering a possible solution.

For what another 8GB costs nowadays, it is nearly worth adding it just to get to 16GB anyway.

If it doesn't solve the problem you haven't mortgaged the house.

---

<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:** [18 March 2022 10:19 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/9 "2022-03-18T10:19:06Z")

</div>

> [@Trying\_to\_learn](#):
>
> **WINDOZE** (10).... 8 GB is the bare minimum to run.

Node red is not Windows. Even on Windows node-red does not need a lot of memory.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [18 March 2022 20:20 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/10 "2022-03-18T20:20:10Z")

</div>

> [@Colin](#):
>
> Node red is not Windows.

From the ministry of stating the bleeding obvious.... ☹

If windows eats memory irrespective of how much Node-Red needs, it will fail.

I give up.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [18 March 2022 20:45 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/11 "2022-03-18T20:45:50Z")

</div>

> [@Trying\_to\_learn](#):
>
> From the ministry of stating the bleeding obvious.... ☹

A tad rude Andrew, especially considering the amount of support kindly given to you by Colin with your own issues...

---

<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:** [18 March 2022 21:21 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/12 "2022-03-18T21:21:11Z")

</div>

> [@Trying\_to\_learn](#):
>
> If windows eats memory irrespective of how much Node-Red needs, it will fail

Nope, modern OS memory management doesn't work like that. I am sure you have experienced yourself what happens to Windows when you overload the memory. It doesn't crash, it just gets slower and slower as it starts swapping RAM to disc. Nodejs is a bit different, as I understand it, it allows itself a fixed amount of memory and if it runs out it crashes in the manner seen here. It is node red that is running out of memory, not the system.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [18 March 2022 21:51 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/13 "2022-03-18T21:51:50Z")

</div>

@TROJAN053 you mention Dashboard... do you happen to have a lot of charts ? or a chart with a lot of points ? Or a lot of data arriving very quick ? The dashboard chart is well known to be a bottleneck and to eat memory when it starts t get loaded.

---

<div class="post-metadata">

**Author:** ![TROJAN053](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@TROJAN053](https://discourse.nodered.org/u/TROJAN053)\
**Post date:** [23 March 2022 10:17 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/14 "2022-03-23T10:17:13Z")

</div>

HI,  
Finally the point of cause detected. We have multiple pages in our dashboard in which 2-3 pages were not configured properly. Due to which JS memory increased while browsing the same page.

---

<div class="post-metadata">

**Author:** ![TROJAN053](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@TROJAN053](https://discourse.nodered.org/u/TROJAN053)\
**Post date:** [23 March 2022 10:19 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/15 "2022-03-23T10:19:31Z")

</div>

We have kept node red under task scheduler to automatically starts when system power. Is there any solution for windows to restart the node red if by any chance node red stops working? As I have observed sometimes the node red stops showing uncaught exception

---

<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:** [23 March 2022 10:47 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/16 "2022-03-23T10:47:21Z")

</div>

> [@TROJAN053](#):
>
> sometimes the node red stops showing uncaught exception

I don't know about restarting it on windows (I think the node red docs on running in windows has a section about that), but if you are getting uncaught exception then you should track down what is causing that. Post the full error output here if it isn't clear why it is happening.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [23 March 2022 11:01 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/17 "2022-03-23T11:01:51Z")

</div>

If you run node-red as a service using NSSM or use PM2 then it will/can auto restart on fail

Search the forum for NSSM or PM2 (been covered many times)

---

<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:** [22 May 2022 11:02 UTC](https://discourse.nodered.org/t/node-red-flow-frequently-stopped/59961/18 "2022-05-22T11:02:45Z")

</div>

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