Node-red aborting

#1

My node-red is aborting. Here is the console output. I am not sure what else to post about this issue. Hopefully this is enough?

Joe

<--- Last few GCs --->
[2454:0x2844f48] 69394 ms: Mark-sweep 124.3 (133.9) -> 124.3 (133.9) MB, 959.4 / 0.1 ms allocation fa ilure GC in old space requested
[2454:0x2844f48] 70483 ms: Mark-sweep 124.3 (133.9) -> 124.3 (132.9) MB, 964.5 / 0.0 ms last resort G C in old space requested
[2454:0x2844f48] 71617 ms: Mark-sweep 124.3 (132.9) -> 124.3 (132.9) MB, 1133.9 / 0.1 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x39d16169
1: /* anonymous / [Function node:3e13664e.f8b7aa:~1] [pc=0x248ce4ec](this=0x2ba07db1 ,m sg=0x25f84151 )
2: /
anonymous / [Function node:3e13664e.f8b7aa:27] [bytecode=0x71d6217d offset=31](this=0x2ba07db1 )
6: /
anonymous */ [vm.js:59] [bytecode=0x525df88d offset=96](this=0x2ba07e05 <ContextifyScript map = 0x4 8b89f5d>,contextif...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
nodered.service: main process exited, code=killed, status=6/ABRT
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool....

0 Likes

#2

Well you could tell us what you are running on, and post the start of the log then you restart node-red. Dependent on your installation you may be able to get that by running

node-red-stop
node-red-start

Also post the log starting a bit before the first error message. Then you could give us more information about the situation causing it. Does it happen immediately on startup. Does it happen when you do something in particular. Anything unusual about your flows?

0 Likes

#3

Your flows are using too much memory.

It could be a leak in one of your nodes (possible, but it usually isn't), or it could simply be the volume of work you're pushing through. Could you describe a bit more about what your flows are doing?

0 Likes

#4

I can repeat it.

I just started playing around with dashboard dropdown and trying to feed it an array of options.

I have a manual inject node that fires off a function that feeds the options to the dropdown. Everything runs great until I activate it. Here is the function code:

var listArray = [];

for (i=1;2;i++) {
    
    listArray[i] = {test:1};
    
}

msg.options = listArray;

return msg;

0 Likes

#5

LOL, it is the for loop!!

Sorry about the bad syntax. But hopefully it points t something fixable in node-red.

I will definitely fix my code.

Joe

0 Likes

#6

As you may have found, your for loop never terminates so will grow and grow until it goes pop. Not much we can do in the runtime to handle user code that goes into a tight loop and never yields.

0 Likes

#7

Yeah, sorry about that!!

Joe

0 Likes