Memory leak Home Assistant (2022)?

I’ve been hoping the same thing, but not yet. Stability is big thing for me with HA and it has been frustrating dealing with this. One thing I’m starting to see, but still testing is that when certain addons are stopped, the rate of memory used declines, but continues to go up. Nothing I’ve done outside of a host reboot has reduced usage in any meaningful way.

Been following this and a few related threads for a while now, as I’ve been working against a slow leak myself here. I’m curious of the cases cited here (@BebeMischa ?) and elsewhere that have potentially attributed this to a ZWave JS update. HA runs on Python, ZWave JS runs on Node.

Can anyone else see if the memory leak concerns are happening in the Python process or the Node process? In my case, it is the Python process running HA that consumes all remaining available memory, not Node. I also then don’t see any ZWave JS updates solving this - unless something in the integration is then also somehow triggering a memory leak on the HA side within Python? I’m also running ZWave JS separately via the ZWave JS UI w/ WebSocket integration, for what it’s worth. I otherwise have no other add-ons - but am dependent on ZWave as that is what all my devices and automation run on - so disabling ZWave is not an option…

@ziesemer I don’t use ZWave, my configuration includes Zigbee@mqtt and MQTT. But the same as You had - python which served for HA instance memory usage grows.
@codemannh did You had a chance to test 2022.10.0 ?

1 Like

I upgraded early this morning. Still seeing ~10MB increase in memory usage for the VM every 12 - 15 minutes, which is what I was seeing before. Also overnight I saw that HA Core was restarted and once the restart finished, the memory consumption doubled from 2.6GB to 5.5GB. Then I did the upgrade and was at 7.8GB. To recover the used memory I rebooted the host. All went back to what it was before. To make a long story longer, no change.

I had a similar problem in late July into August and I narrowed it down to the ONVIF integration built into HA. In late July, a thread stated it was fixed but no HA version updates ever fixed it for me so I removed it and I now have a completely flat memory usage all day, every day.

I’m just mentioning this in case you might be using the ONVIF integration and this might help.

@clearwave1 Thanks for reply!
It is very interesting, I’m also using ONVIF integration.
For now will try to switch to generic camera integrations.
Does anybody in the thread experienced in memory leaks use ONVIF integration too ?

Thank you!

Wondering if you’ve potentially found the root cause in your system?
My system doesn’t shutdown/reboot it just becomes so slow that its all unresponsive until I perform a manual hard reset.

Anyway, hoping this ties me over until a root issue is found and then fixed :pray:

Update
Unfortunately this doesn’t seem to have worked…just noticed my server was unreachable, checked with the physical monitor and the python3 service was once again eating all the RAM.

Think I’m going to have to disable my integrations and bring them back one by one as @tom_l suggested.

@gid204 Do you have OVIF integration in your system?

I had readoff of my ONVIF and will try 22.10.5 hopefully after w/e
Update:
Some memory utilization graph after switching to generic camera integration

I do not…only a handful of integrations and some custom integrations using HACS.

In frustration I wasn’t very methodical and just started wiping my setup, integration by integration whilst monitoring the memory in real time. At one point it stopped rising so I stopped nuking things.

I’ll re-add one integration everyday to see if I can find the culprit.

I have been leeking mem problem two weeks now. it seem to bee HA it self that use that all mem.
I use Clanse to see mem usage. **image
**


I haven’t found any help yet. Much restart HA every day.

As was advised in other threads, highly likely in this memory utilization behavior caused some integration.
I’m not 100% sure what exactly is in my case, but as guess it might be ONVIF integration - I’m currently monitoring my memory utilization.
The only way to catch it (long and hard), as mentioned by @gid204 is switch it on one by one and monitor your memory utilization.

In my case there is no ONVIF integration. How to monitor integration mam usage? in Glanses is show add .ons

Have you got any custom integrations installed via HACS (or otherwise)?
If so:

  1. Take a note of what you have installed
  2. Completely remove all of them. You should hopefully see the memory leak stop.
  3. Add the custom integrations back one by one around 24 hours apart (giving it enough time to leak if its the culprit).

Now if you haven’t got any custom integrations you may need to do the above with the the official integrations you have installed…but I can’t imagine they would cause such an issue.
Either way its going to be quite disruptive to your setup obviously but it’s really the only way to do it (as far as I know).

Good Luck!

Thank you help. I have very many custom integration installed be HACS so it will take time to find correct one.

Same here started in July ~11th -

on my side, recent discovery of this memory foot print rising very fast :
image

From ssh console, I can say its “homeassistant” docker that inflates.

Its starts around 17% and rises…

How can I isolate ?

Thanks to above comments I deactivated “ONVIF” camera integration.

It looks like its had some effect. Its gone for now. I am waiting to see if it re-appears.

image

For me is helped to stop ONVIF integration,
I’m also migrated to clear the Debian 11 build (usual 50% mem utilization) from Raspberry Debian 32 (usual 25% mem utilization).

Home Assistant 2022.11.4 Frontend 20221108.0 - latest

For me it just started from a recent update and HAOS running inside proxmox for HA was shutting down after a few minutes with 4gb RAM bumped it up to 12Gb and it lasts 30 mins , also noticed with 12 cores it will not even boot with a heap of missing dependencies 6 cores booted

normally it sits 3Gb

First I bumped up to 6Gb and noticed it stayed online a bit longer
then put it to 12Gb out of 64Gb on the main system
no point in going higher than that as then I will be over the other 2x Laptops 16Gb RAM capacity and
proxmox HA replication will break

also nothing is really running as its currently in safe mode


Even Proxmox at the start of Nov started using more memory running HAOS normally it idled along under 3Gb then Doubled

the Home Assistant container seems ok so its something on HAOS

edit
nothing to do with
Open Network Video Interface Forum
no camera’s in the system

I only use Home Assistant for monitoring water temps and solar power for Aquaponic system
so many ESPHome units

how ever the constant stopping started at the same time as this report
took me a while to work out why HA was always in a stopped state
(instead of a reboot when memory ran out it seemed to just turn off and no logs )

The more recent issues with memory reported in this thread starting with 2022.11.3 AND running ONVIF is quite likely this:

The OP’s memory issues, and those reports prior to 2022.11.3 are not as likely to be the issue described in bug #82309.