# Node-red terminating indefinitely

**URL:** <https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079>\
**Category:** General\
**Created:** [21 January 2019 07:22 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079 "2019-01-21T07:22:16Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [21 January 2019 07:22 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/1 "2019-01-21T07:22:16Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 January 2019 08:03 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/2 "2019-01-21T08:03:10Z")

</div>

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?

---

<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:** [21 January 2019 08:20 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/3 "2019-01-21T08:20:27Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [21 January 2019 10:26 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/4 "2019-01-21T10:26:34Z")

</div>

> [@ukmoose](#):
>
> ing in

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/ae012b1c3ad5d9d9e4c6e191ac716edeb1dfc109.png)

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [21 January 2019 10:28 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/5 "2019-01-21T10:28:46Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/89facbe6d2f855908d41ffba8e2a18ae676896e3.png)

---

<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:** [21 January 2019 12:23 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/6 "2019-01-21T12:23:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [21 January 2019 12:38 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/7 "2019-01-21T12:38:24Z")

</div>

Even I deploy other basic examples node-red is crashing

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [21 January 2019 12:39 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/8 "2019-01-21T12:39:32Z")

</div>

with the same message?

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [21 January 2019 13:39 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/9 "2019-01-21T13:39:22Z")

</div>

Yes with the same message it is crashing

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [21 January 2019 13:50 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/10 "2019-01-21T13:50:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [22 January 2019 04:42 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/11 "2019-01-22T04:42:40Z")

</div>

I have used new flow for it

---

<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 January 2019 07:02 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/12 "2019-01-22T07:02:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [22 January 2019 14:47 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/13 "2019-01-22T14:47:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gsr](https://avatars.discourse-cdn.com/v4/letter/g/eada6e/32.png) [@gsr](https://discourse.nodered.org/u/gsr)\
**Post date:** [22 January 2019 14:47 UTC](https://discourse.nodered.org/t/node-red-terminating-indefinitely/7079/14 "2019-01-22T14:47:56Z")

</div>

Thank you all for your wonderful support
