Memory leak after updating to 2022.4?

Weird i’m not having that issue on my main server,

Just started recording my [sensor.processor_use]
Its constant between 4 and 15% having a lot of add-ons installed.

On my other machine there is a problem
Its above the 30-50 i need to check why …

I kept 2022.4.1 running on my dev system and it seems to have stabilized at around 47% (1GB Pi3) for me. So I guess the initial increase I saw was due to the cache and not the memory leak.

How much memory can HA address? If it is 32bit then it should not be more that 4GB (likely a bit less). I ask because I assigned 6GB to it in proxmox and I never caught it use it all up however I did get the impression that HA restarted itself several times since the upgrade.

This is where I am now :

@shieldsit It is my understanding that you cannot judge the actual memory usage from Proxmox. You need to look at what Home Assistant reports instead. I forget exactly why, but it was something along the lines that all the memory is made available to HA but it won’t necessarily use it. 12GB is likely super overkill. Did I say “super”?? :wink: I assigned only 6GB and I new saw it reach the top even though judging by Proxmox it is always there:

This is what Home Assistant reports (visualized with Grafana addon):

I am pretty sure that smooth section is when I upgraded to 2022.4 and my hell (unrelated to alleged memory leak) started. I hope to sort that out later tonight when I get my new zigbee controller.

EDIT:

Just noticed that Proxmox was showing me just a few hours of memory usage so I changed it to days. It indeed looks different so maybe my understanding is not exact, however it still really doesn’t match what the system reports. For the experts out there… what should I be looking at?

Here’s mine, running on VirtualBox. HAOS

Here is mine for right at this moment. System doesn’t respond so I have to reset because reboot doesn’t do anything.

And this is the console. Earlier I said I thought it was a kernel panic but it doesn’t look like it is.

And here is after a reset. You can see that over time it ramps up to use all memory. Normally, in the past 3GB was the most I’ve seen it use.

Also, you can see that the guest agent dies as well, that’s probably why it has to be reset.

After more than 24H I can imagine that the memory use will always increase and make my production system unusable (as per attached pictures,system just started and 24 hours later),and this is unacceptable for me due to security reason.
I’ve got backups,but I will lose data recorded for some days,so which is the best way to revert back to 2022.03 ?
Thanks in advance.Schermata 2022-04-09 alle 20.35.30
Schermata 2022-04-10 alle 20.03.13

I also see this on 2022.4.1. Unfortunately, all my data is based on Glances integration which has been broken for a while now (fails to reload after restarting HA but works after an upgrade) so my data is a bit sparse as of late but here’s the last 30 days of memory consumption:

I’ve also noticed that my memory usage in the supervisor appears to be incorrect (at 0%!):
image

Такая же проблема. Растет использование памяти до 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.
Regards

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.