# RangeError on using Gauge / memory leak?

**URL:** <https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083>\
**Category:** General\
**Created:** [14 July 2022 09:38 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083 "2022-07-14T09:38:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [14 July 2022 09:38 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/1 "2022-07-14T09:38:52Z")

</div>

I am using a gauge node to count down how long a switch is set to state "on". I t will tick down to zero.  
Yesterday I saw massive "RangeError: Maximum stack size exceeded". I saw it often that node red runs on mem limit (4GB Raspberry) and crashes from while to while. I guess the are memory leaks in node red. O I just messed it up somewhere in the code 😉

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/8/c81b9484f8b553aa10e624d59934c734e30d50d3.png)

---

<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:** [14 July 2022 10:00 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/2 "2022-07-14T10:00:31Z")

</div>

Most likely a problem with your flows I think.

Stop node red and start it again in a terminal, wait for the error to appear, and post the full terminal output here. Copy/paste please, not screenshot. Use the `</>` button at the top of the forum entry when pasting it. To stop and start it again, provided you used the recommended pi install script then you can use  
`node-red-stop`  
`node-red-start`

**[Edit]** What makes you think it is a problem with the gauge node?

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [14 July 2022 18:01 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/3 "2022-07-14T18:01:56Z")

</div>

I think it is gauge node because it was highlighted when I moved the mouse over the error message.

---

<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:** [14 July 2022 20:15 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/4 "2022-07-14T20:15:45Z")

</div>

Are you going to post the log?

Also it would be worth adding a debug node to see at what rate you are sending messages to the gauge, in case you are sending them faster than they can be processed.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [15 July 2022 14:21 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/5 "2022-07-15T14:21:42Z")

</div>

since this error does not accrue often and I updated to NR 3.0 I ve to wait for a log where its tracked.

---

<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:** [15 July 2022 15:57 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/6 "2022-07-15T15:57:54Z")

</div>

In the meantime post what you see on startup, that may give us useful information.

---

<div class="post-metadata">

**Author:** ![WhiteLion](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/whitelion/32/12266_2.png) [@WhiteLion](https://discourse.nodered.org/u/WhiteLion)\
**Post date:** [15 July 2022 16:59 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/7 "2022-07-15T16:59:46Z")

</div>

sure. the log is attached  
[startup.log](https://discourse.nodered.org/uploads/short-url/tpz6x1aKkMGZqlEPutiwXHF6tXv.log) (956.3 KB)

---

<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:** [15 July 2022 18:50 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/8 "2022-07-15T18:50:48Z")

</div>

I don't think it is necessary to have the log level set to trace in settings.js, otherwise you will generate massive log files. For the moment I suggest reverting it to the usual setting which is `info`.

However, it has showed that you appear to be fetching the nodejs version every 25 seconds or thereabouts, which seems a bit odd. I would not expect that to be the problem though.

Did you do what I suggested earlier which was to put a debug node showing what is going into the gauge to see what rate it is being updated at in normal operation?

Also I suggest running `top` in a terminal for a while and watching whether anything appears to be using a lot of memory or CPU. Post a screenshot of that after it has been running for a while.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 September 2022 18:51 UTC](https://discourse.nodered.org/t/rangeerror-on-using-gauge-memory-leak/65083/9 "2022-09-13T18:51:22Z")

</div>

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