Memory leak after updating to 2022.4?

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

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.