# Node-red aborting

**URL:** <https://discourse.nodered.org/t/node-red-aborting/5126>\
**Category:** General\
**Created:** [22 November 2018 20:07 UTC](https://discourse.nodered.org/t/node-red-aborting/5126 "2018-11-22T20:07:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)\
**Post date:** [22 November 2018 20:07 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/1 "2018-11-22T20:07:55Z")

</div>

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

---

<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:** [22 November 2018 20:58 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/2 "2018-11-22T20:58:38Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 November 2018 22:30 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/3 "2018-11-22T22:30:30Z")

</div>

> [@jmorris644](#):
>
> JavaScript heap out of memory

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?

---

<div class="post-metadata">

**Author:** ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)\
**Post date:** [23 November 2018 14:39 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/4 "2018-11-23T14:39:51Z")

</div>

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;

---

<div class="post-metadata">

**Author:** ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)\
**Post date:** [23 November 2018 15:09 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/5 "2018-11-23T15:09:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [23 November 2018 15:13 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/6 "2018-11-23T15:13:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jmorris644](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jmorris644/32/31964_2.png) [@jmorris644](https://discourse.nodered.org/u/jmorris644)\
**Post date:** [23 November 2018 15:25 UTC](https://discourse.nodered.org/t/node-red-aborting/5126/7 "2018-11-23T15:25:01Z")

</div>

Yeah, sorry about that!!

Joe
