Memory leak after updating to 2022.4?

Такая же проблема. Растет использование памяти до 90 и более %, затем перезагрузка. По графику использования памяти - после обновления 7 апреля.

If you use the default database option (the SQLite file in /config) then you would need to copy your db file somewhere else and copy it back after. Rolling back ha will restore the entire /config folder on including the db file. If you use an external db (like the mariadb addon) then just don’t restore that addon.

That being said, 2022.4 included a db migration. So I would not recommend rolling back ha and not the database. Especially in this case, this was a big one. Sometimes it’s just adding a new index which is probably fine in prior versions but this one completely changed how attributes were stored. I very much doubt a db migrated for 2022.4 would work in 2022.3.

I’ve been having memory leak issues since upgrading but I blamed it on Frigate. Restarting Frigate caused the two large drops below.

1 Like

Same issue after upgrading. It crashes after about 12 hours when memory is exhausted. I’m remote at the moment and can’t reboot it to show my integrations etc. however they are minimal.

According to GitHub issue, it’s traced down to stream integration, related to camera streams.
Disabling stream and restarting HA of course stopped memory leak. So hopefully, fix is not far.

Thank you, I just restored the whole backup (ok,lost two days of data,but it’s not the end of the world) and everything is fine now…waiting for the fixed release,so also my database will be upgraded.

The same here, after the upgrade to 2022.4.0 and 2022.4.1 the memory usage increases very fast.

2022.4.2 is out now with a fix for the camera stream memory leak.

I have upgraded to 2022.4.2. Hopefully, the memory leak problem is solved. Will notice within the next 24 hours.

1 Like

Thanks. I waiting for your test result.
P.S. Sorry for my bad english/

I thought the update fixed it, but after 2/3 days I’m still having the same issue.

My HA memory usage has stayed under 650MB.

On my HA the 2022.4.2 did solve the memory leak problem. Last 36 hours no increase of unexpected memory usage. Stable on average 50% percent. I have now updated the HA core to 2022.4.3.

Also for me 2022.4.2 update fixed the issue. Before the update I tried to disable all cameras as an first aid and that also worked for memory leak.
Now with update Onvif cameras are active and all is fine. After the update I did reboot the host if it matters.

Thanks for the HA team fo quick fix!

As an FYI for others: This leak is different and is being tracked here Memory Leak Persists After Core Upgrade 2022.4.2 · Issue #69934 · home-assistant/core · GitHub

Note that I’m still seeing a memory leak on the stream component in 2022.4.5. Not while running the stream itself, but when the stream gets started / restarted.

1 Like

Just wondering if any of you have gotten to the source of this?
I’ve been experiencing since 2022.4 as well, and just had another crash due to out of memory. I’ve now got 24Gb assigned to my VM since it was still crashing at 16. I used to have 8Gb assigned prior to last month.

You should open an issue on github if one isn’t already open regarding this.

I was experiencing this too. I noticed some errors in the supervisor log re. Samba add on although it was working ok. Since I stopped the addon last night my memory leak has vanished.

I observed that in my case is only buffered/cached memory.

on the HA host i run these command:

# free -h
               total        used        free      shared  **buff/cache**   available
Mem:           7.8Gi       1.3Gi       304Mi       4.0Mi       **6.2Gi**       6.4Gi
Swap:          2.6Gi        12Mi       2.5Gi

sync; echo 1 > /proc/sys/vm/drop_caches
sync; echo 2 > /proc/sys/vm/drop_caches
sync; echo 3 > /proc/sys/vm/drop_caches

# free -h
               total        used        free      shared  **buff/cache**   available
Mem:           7.8Gi       1.2Gi       6.2Gi       4.0Mi       **353Mi**       6.4Gi
Swap:          2.6Gi        12Mi       2.5Gi