Node red flow frequently stopped

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

You may need to share more information:

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

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.

Maybe more sheep (Ram)?

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?

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.

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.

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.

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

From the ministry of stating the bleeding obvious.... :frowning:

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

I give up.

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

1 Like

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.

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

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.

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

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.

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)

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