How would I find a "memory leak"?

Folks, I have a RasPi Raspberry Pi 3 Model B+ Rev 1.3
It also has a RGB led strip on it. But not much else.

Over time the memory used keeps increasing and it is up to 93%

I seem to remember if I restart NR, the memory use is reset.
So it kinda points to NR.

Most/all the subflows are used on other machines and they don't have the memory leak problem, so it kind of rules them out.

I guess I could go along and disable tabs and see what happens.

Thoughts?

Version of NR might also help Andrew.

NR 4.0.9
Node JS 18.20.8
Buster

{"nodered_version":"4.0.9",
"nodejs_version":"18.20.8",
"npm_version":"10.8.2",
"nr_started":"2026-06-09T06:11:02+10:00",
"hostname":"TelePi",
"os_pretty":"Raspbian GNU/Linux 10 (buster)",
"release":"Linux 5.10.103-v7+ armE","os_installed":"2021-12-02T13:34:43+11:00",
"last_reboot":"2026-06-05T07:28:30+10:00",
"cpu":"ARMv7 Processor rev 4 (v7l)",
"cores":4,"totalmem":"0.9 GB",
"freemem":"67 MB","loadAverage":"load1min":2.08,"load5min":1.47,"load15min":1.33},"networkInterfaces":{"lo":[{"address":"127.0.0.1",
"netmask":"255.0.0.0","family":"IPv4","mac":"00:00:00:00:00:00","internal":true,"cidr":"127.0.0.1/8"}],"wlan0":,"internal":false,"cidr":"192.168.17.33/25"}]},"collected_at":"2026-09-20T09:53:15.109Z"}

How are you measuring the memory at 93%?

What does top show?

I used memory (node)
node-red-contrib-os

Screenshot:

Same on all machines how I get the value.

It is true that you have pretty much run out of memory, you can see that from the fact that you are using lots of swap memory, and the Avail Mem figure is very low. Node red is using about 1/4 of the total memory, my home automation on a similar pi uses about 5% so there may be a leak. Restart node-red and see if the memory used by node-red does increase over time.

Note also that lxpanel is using twice as much as node-red. Are you actually using the GUI? I always use the Lite version of OS without the GUI, so, if lxpanel always uses that amount, have effectively twice as much memory available in the first place as you have.

Thanks.

But I have 3 machines, similar specs. All running the same.

This one's memory keeps getting eaten and I don't know how/why.

99% sure a restart of NR fixes the problem and the memory usage goes back to like 40%, but then starts to creep up aagain.

I've got the SD swap file disabled - on all 3 machines.

Hmmmmm....

Restarted on that machine.

Not looking good.

(Ok, why can't I drag/drop piccies now?)

These two are good.

Starting at 85% used.
Ok. Something/one else is happening.

Ideas on how to find it?

(P.S. I have htop rather than just top if that would help)

Restart it and use top to check what is using the memory, I prefer that to htop but that is just because I am used to it.

This is what I see with top.

So the amount of memory used by node-red is high, but not increasing. The processor is pretty high too.

lxpanel seems to have disappeared. You didn't answer the question about whether you use the GUI on the pi.

Sorry.

Now and then I VNC to it.

BTW, I restarted NR. NOT the machine.

I'm not sure if this one has less memory than the other TWO machines.
(Sorry, I'm rambling.)

Interesting you say the CPU load is high.
(And I won't dispute it)

But the rub this end is I am getting different readings depending on who I ask.

I have node-red-contrib-cpu installed and it sends me the total of all cores.

Here's the 3 machines side by side for load.

And 17% seems......... ok.

TimePi is the hardest working.
It is also a WAP and NTP server.
Any way.....
Sorry.

But that's how I'm seeing things.

A bad idea in my opinion. The effect is that you are using up some of your 1GB RAM as swap, which is pointless. Specifying swap to SD card will give you 20% more RAM. With swap to SD then you might find it doesn't need to use it because you have more RAM available. If you find you are using much swap then you have a problem.

Run top again and then hit Shift-M which will sort by memory usage rather than CPU (which is the default). What does it show then?

As requested.

Did you do that using VNC? As you can see lxpanel is clobbering your system, both CPU and memory.

If you shutdown VNC and use ssh what does it show?

Indulge me.

For the sake of comparing same with same.

We have TelePi.

This is TimePi.

And this is BedPi

Given they are 95% the same.

Thoughts on what's going on?

No, all done via SSH log in.

Would it be a good idea to reboot the machine (as opposed to just restarting NR)?

You have a problem with lxpanel, obviously. A reboot may be the best way to sort that. You didn't sort by memory on the others so can't see if anything is using to much memory on them.