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.
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.
Regards
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.
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.
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.
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 have had a memory leak on an 8GB Ubuntu Laptop for quite a while. HA running in Docker container.
Thank you for the commands to reduce the cache but I suspect that there is still a memory leak somewhere. After a few weeks it is impossible to use the system even via SSH.
Some time ago I had to increase the size of the swapfile something silly but the demand on physical memory and the paging renders the system unresponsive.
I have recorded the free stats and it grows daily. After decreasing the cache, here is the output from the free and top commands from within Docker:
Ubuntu-Laptop:/config# free -h
total used free shared buff/cache available
Mem: 7.6G 6.3G 1.0G 36.1M 327.8M 1.1G
Swap: 9.9G 1.8G 8.1G
Mem: 6914636K used, 1096464K free, 37044K shrd, 4832K buff, 260672K cached
CPU: 2% usr 0% sys 0% nic 97% idle 0% io 0% irq 0% sirq
Load average: 0.28 0.43 0.61 1/761 81002
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
815 65 root S 16.0g 208% 4 0% python3 -m homeassistant --config
80919 0 root S 2612 0% 2 0% bash
81002 80919 root R 1624 0% 4 0% top
1 0 root S 440 0% 6 0% {s6-svscan} /package/admin/s6/comm
25 1 root S 216 0% 3 0% s6-supervise s6rc-fdholder
16 1 root S 216 0% 5 0% s6-supervise s6-linux-init-shutdow
26 1 root S 216 0% 1 0% s6-supervise s6rc-oneshot-runner
65 1 root S 216 0% 6 0% s6-supervise home-assistant
34 26 root S 208 0% 1 0% {s6-ipcserverd} /package/admin/s6/
19 16 root S 204 0% 3 0% {s6-linux-init-s} /package/admin/s
Ubuntu-Laptop:/config#
There are no unusual integrations so is it a matter of bouncing the system every few weeks?
(I am not brilliant at Linux performance but a lifetime on VMS has given me a good background in diagnostics.)
Any help would be gratefully received as I love HA and the effort which has gone into it and the integrations.