Node-red terminating indefinitely

#1

Node-red is terminating after few minutes of running and the error in the command prompt is
"FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory", I am using windows 10 os and RAM is 8GB. Does anyone have a solution?

#2

You should be able to start by moving your flows file to a new name and then starting Node-RED.
See the docs for how to do this

But what were you doing in Node-RED?

#3

Essentially, your flows are using too much memory. The solution will depend on what your flows are doing. Are handling lots of messages, or large objects? If it happens after only a few minutes, your flow must be actively doing something, rather than waiting passively for an event to occur.

#4

reading a sensor serially and store it in a file with time stamp

#5

I have a serial port which publishes 100 readings per second. Even when serial ports are disconnected node-red is crashing. the function block consists of following code.

image

#6

What hardware is this running on ? 200 messages a second (100 x two inputs) is quite fast.... The main issue may in fact be sending it to the debug nodes that have to send everything to the screen... it may work better without the debug nodes, though 200 msgs sec may still be too fast for the file writes when the files start to get large.

#7

Even I deploy other basic examples node-red is crashing

#8

with the same message?

#9

Yes with the same message it is crashing

#10

When you ...deploy other basic examples node-red is crashing - are you deploying these tests in the same Node-red that has the 100/sec reading? Or do you start with a blank flow when you statup NR?

#11

I have used new flow for it

#12

Post what you see in the terminal when you start node red from a terminal. The log starts with a Welcome to node-RED message. Include the command you used to start node red when you copy/paste. You can copy from a terminal using Ctrl-Shift-C.

#13

I re-installed node.js and now its working fine

#14

Thank you all for your wonderful support