HA Blue: Persistent High Swap Usage and High Memory

I’ve had the HA Blue for a good while now and in the last few months or so i’ve noticed that both the swap and memory usage have been creeping up.

I’ve tried the obvious things i can thing of like:

Getting rid of unused addons
Purging the recorder data to keep just 7 days of data.
Countless restarts

System Info:

  • Home Assistant Blue / Hardkernel ODROID-N2/N2+
  • Core 2024.5.3
  • Supervisor 2024.05.1
  • Operating System 12.3
  • Frontend 20240501.1

At this stage the last reboot was last night (13 hours ago) and you can see here that the swap and memory usage spike pretty much right away.


Below is a look at the Glances for my system but to be honest i’m not entirely sure what I need to be looking for.

You need to understand memory handling in a modern OS.

I would look if you have a custom integration that was poorly written causing issues. (Breaking Thread Rules)

1 Like

Thank you for this. I think it might be very helpful. You don’t happen to know how to read the data returned from the profiler by any chance?

I can’t get the data from the callgrind as it’s producing an error when i run the command. I can however get the SVG for the cprof. I think it shows me where the leak is, but to me it offers no clues.

Specifically, no, but I would look for any custom integrations that is says are doing bad things and remove them. I think that is the point.

Some of the stuff people wrote are causing thread intrusions into other operations due to being poorly written. These ware causing minor hard to find issues all along, unknown lockups and corruption. Now with the latest python in core, it is outright causing havoc. They need to be removed and written properly.

These are nearly all custom integrations, although if you look at the release notes, a few core integrations were also doing bad things and have been patched in the latest . releases. There are MANY custom integrations doing bad things, however.

Update:

The main culprit seems to be the ring-mqtt HACs integration. I also removed some unused integrations and everything seems to have stabilised…for now.

Thanks for you help!

1 Like

Add an issue to the integration your findings, maybe you can get it fixed and go back to using it.

False alarm, I left it for the weekend and it’s 99% swap usage :roll_eyes:

You say false alarm, but 99% full on swap is not a normal thing either unless tou have less than 2gb of memory. I would look at that link I send above and see if you have a misbehaving custom integration. Signs are there…