# Memory usage grows steadily

**URL:** <https://discourse.nodered.org/t/memory-usage-grows-steadily/97728>\
**Category:** General\
**Created:** [21 June 2025 12:42 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728 "2025-06-21T12:42:49Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [23 June 2025 19:09 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/22 "2025-06-23T19:09:22Z")

</div>

Could you share a very simple repro flow that you can observe the same thing happening? This way someone here can take a look. Thanks

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [24 June 2025 08:20 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/23 "2025-06-24T08:20:45Z")

</div>

@AllanOricil  
What are you referring to exactly?  
Anyway, after having sorted out the errors I had, it's evident that the issue was not NodeRed related but to the lxpanel process. I tried to restart that process and the memory usage went immediately down to 15%. Looking around I found a thread were it seems that lxpanel is poorly written and some of its widgets have memory leaks.  
I am trying disabling the widgets one by one and see what happens.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 June 2025 09:15 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/24 "2025-06-24T09:15:35Z")

</div>

(just passing and reading.)

May I ask what the cause of the _ERRORS_ (that you fixed) were?

That

> [@pacmanmt](#):
>
> `Node object is not a node-red Node`

Is of slight concern - for me.

Yeah, I am not fully up to speed on what all the _in's and out's_ are.  
But.....  
**is not a node-red-node** is curious.

Also, what are all the `Serialconfig` lines?  
Sure they are allowed, but just asking in passing.

Something else which may be an issue.  
Context is stored in memory.  
If you have a lot of stuff stored, that may be a vector for memory usage.

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [24 June 2025 12:31 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/25 "2025-06-24T12:31:38Z")

</div>

The error you are referring to was caused by moving-average-contrib that every now and then was fed with an undefined payload. I tried to find from where and when the undefined was coming from and eventually I replaced that contrib with another one.  
Regarding the serial connections, they are usb to serial converters coming from different devices that are fed into the raspi and managed from NodeRed flows; there are 11 of them connected to solar controllers, battery monitors, LiFePO4 BMSes, ZigBee hub and wind turbine controller.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [24 June 2025 20:54 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/26 "2025-06-24T20:54:24Z")

</div>

Ok.

So what about the context stuff?

Are you storing a lot of data as/in context?

I'm also wondering if you are making average readings/values for things: is that eating memory?  
(Depending on how it is doing it.)

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [25 June 2025 06:06 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/27 "2025-06-25T06:06:38Z")

</div>

@Trying_to_learn  
I save a bunch of values into flow variables but nothing to be noted and the moving average just updates the same variable overtime.  
Anyway the analysis for the NodeRed memory use showed that it never goes past 3%.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [25 June 2025 07:02 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/28 "2025-06-25T07:02:05Z")

</div>

> [@pacmanmt](#):
>
> The pi is an headless one

Is this really true though ? You are running vnc server and lxpanel, which indicates a desktop environment.

Once you connect with vnc, ram usage will ramp up quickly - and specifically lxpanel has reported memory leaks (as per google).

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [26 June 2025 06:31 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/29 "2025-06-26T06:31:48Z")

</div>

In my post #21 of this thread, I already said that lxpanel has memory leaks and that I am disabling the widgets to see if anything improves.  
I already mentioned that it is headless and I connect via vnc only to make configuration changes, I am not using the pi as a desktop computer. The memory usage increase was ramping up without connecting in any way to the pi.

---

<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:** [26 June 2025 09:47 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/30 "2025-06-26T09:47:41Z")

</div>

> [@pacmanmt](#):
>
> The memory usage increase was ramping up without connecting in any way to the pi.

Also the memory ramp up has nothing to do with node red as far as we know.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [26 June 2025 09:53 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/31 "2025-06-26T09:53:59Z")

</div>

> [@pacmanmt](#):
>
> I connect via vnc only to make configuration changes, I am not using the pi as a desktop computer

Just to note that VNC **_IS_** a desktop, it does have a significant impact. I have a container that runs VNC so that I don't have to leave it running all the time as I very rarely use it.

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [26 June 2025 20:05 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/32 "2025-06-26T20:05:09Z")

</div>

Sure enough, at the beginning I was wondering if any flow I made could possibly had something wrong, but this was not the case either.

---

<div class="post-metadata">

**Author:** ![pacmanmt](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pacmanmt](https://discourse.nodered.org/u/pacmanmt)\
**Post date:** [26 June 2025 20:08 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/33 "2025-06-26T20:08:00Z")

</div>

Sure, but I have never said that the configuration was not a desktop one, simply that I was not using it as a desktop computer. 😉

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [29 June 2025 10:35 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/34 "2025-06-29T10:35:32Z")

</div>

Not getting at you. It is simply that using any kind of desktop on a Pi along with other things sucks up a LOT of resources. If you are having resource issues, this is something to look at early. In particular, once your Pi starts to use SWAP space, performance can take a nose-dive.

---

<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 July 2025 10:36 UTC](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728/35 "2025-07-13T10:36:11Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/memory-usage-grows-steadily/97728.md?page=1)
