core
core copied to clipboard
Home assistant memory leak
The problem
After update to version 2024.8.0 and 2024.8.1 home assistant once started consumes bigger amount of memory in time line. At start RAM memory use is ~2,1GB, and after couple of hours increase to ~7 or more GB and VM killing process (python3) due to out of memory. Glance add-on show that most of the memory is consumed by "homeassistant" process but don't know what exactlly is going on.
What version of Home Assistant Core has the issue?
2024.8.1
What was the last working version of Home Assistant Core?
2024.7.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
I can't confirm this. I am on the new version 2024.8.1 and I need about 2.5 GB without a steady growth.
Please try booting in safe mode and check if it persists
After HA restart thru the night (8hours) RAM consumption raised up from 2.1GB to 6.4GB, hard disk drive spaceallocated to HA from 40% to 71% and medium CPU usage is about 75-80% thru all the night whitch never hapened before
I'll try with safe mode.
I can confirm, I have the same issue.. After Update, memory leak occurs randomly..
15:10 was update from 2024.7x - 2024.8.1 6 memory leaks, interresting that during night it was OK.
Met the same situations, the memory usage always in growth
Currently in 2024.8.1, the usage drops only when I restarted ha core or docker
I found same problem T T
Unfortunately, I also have the same problem. Fortunately, I replaced the RPI two weeks ago. Instead of 2GB, it now has 4GB. Without the replacement, my HA would probably be full by now.
I was running HA in Proxmox and watched memory usage rocket. Decides to install bare metal and still the same. I've had to setup an automation to restart HA Core Integration every 3 days. Is anyone looking into this memory leak we are experiencing?
Having the same problem. I think it exist a few months, where HA kept going inresponsive. It got better since I edited templates that gave errors in the log, but still the memory usage grew. Today I dit a fresh install on Proxmox and also now the memory grows. Probably there is someting in the way HA treats the templates. I now have an automation that reboots HA when free memory gets below a limt. But this is not how it should work.
I’ve been also having this issue. Solution right now is restart the node when memory usage is above 7gb. See proxmox graph:
Update:
Changed all templates. Mostly trigger based now. Memory use is still slowly growing. Graph shows 96 hours. You can see reboots. Mostly the reboots are for updates. I also made an automation ther reboots HA when memory is low.
Please follow the instruction at
Tracking down a memory leak of python objects
https://community.home-assistant.io/t/2024-5-tracking-down-instability-issues-caused-by-integrations/724441
I'm seeing the same on 2 of 3 vm's running HA OS on Proxmox.
Production HA:
Test HA:
It's crazy in my Mac, it consumes 98.58GB and the system warns me.
i'm also experiencing this issue in a Docker instance on a Raspberry Pi 4 8gb. I've seen some threads relating this issue with Alexa Media Player addon but i don't have this and the issue occurs. I've starting to see this issue after upgrading to 2024.10.
Unfortunately, I also have the same problem. Fortunately, I replaced the RPI two weeks ago. Instead of 2GB, it now has 4GB. Without the replacement, my HA would probably be full by now.
Everything has been ok for me again for some time, I didn't take any solutions, it went away on its own.
Same issue but after upgrading to 2024.10.4. Reverting back to 2024.9.3 fixed the memory leaks. Tested with "Glances" addon. Container "HomeAssistant" is the one leaking on memory (~10MB per 5-10min).
Upgrading to 2024.11.2 fixed my memory leaks
Not for me. Still hungry for memory.
@RadekLorenc I had similar issues recently, and since removing the Zigbee2MQTT add-on from the HA, the python3 memory leak is no longer there. I migrated it to another docker host and it is even more responsive now.
I've been suffering memory issues for the past couple of days. I've installed the Glances add-on and it seems Supervisor is the culprit - it's currently consuming half (15GB) of my total memory!
@DJBenson :thinking:, anything in the Supervisor logs which might explain what is going on?
@DJBenson :thinking:, anything in the Supervisor logs which might explain what is going on?
I don't I'm afraid. I spotted the issue at 00:30 and wanted to sleep so I just killed the Supervisor container and it seemed to sort itself out. That container hasn't used more than 256mb of memory today though.
I did notice that Supervisor was crashing every 10 minutes or so, maybe because of the memory leak or something else causing it but I was short of time as above so didn't dig deeper.
For me, the problem has disappeared by itself. I did nothing except install the usual updates. But since then it's been quiet.
I don't I'm afraid. I spotted the issue at 00:30 and wanted to sleep so I just killed the Supervisor container and it seemed to sort itself out. That container hasn't used more than 256mb of memory today though.
Yeah that sounds like normal level. If the issue comes back, please open an an issue in the Supervisor repository at https://github.com/home-assistant/supervisor along with the Supervisor logs.
I still have no luck on this. I need to restart homeassistant time to time
~# free -m total used free shared buff/cache available Mem: 15770 10335 214 12 5251 5435 Swap: 975 542 433
~# ps aux --sort=-%mem | head -n 11 USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 433643 3.9 54.8 11717368 8863936 ? Ssl Nov24 119:35 python3 -m homeassistant --config /config root 81336 0.3 1.0 481116 173308 ? Ssl Nov21 23:07 python3 -m supervisor root 89378 2.0 1.0 21435104 164252 ? Sl Nov21 140:43 node-red root 81683 1.1 0.7 11240824 127108 ? Sl Nov21 77:10 node index.js root 638584 0.0 0.7 441232 123364 ? Ssl Nov25 0:21 /usr/local/bin/python3.12 /usr/local/bin/matter-server --storage-path /data --port 5580 --log-level info --log-level-sdk error --primary-interface enp2s0 --paa-root-cert-dir /data/credentials --ota-provider-dir /config/updates --fabricid 2 --vendorid 4939 --listen-address 172.30.32.1 root 581603 0.0 0.7 11227644 113144 ? Sl Nov25 0:32 node index.js root 300607 0.6 0.6 11224996 112892 ? Sl Nov23 27:38 node index.js root 279 0.0 0.5 135912 93636 ? Ss Nov20 3:54 /lib/systemd/systemd-journald root 793 0.6 0.4 3523640 78212 ? Ssl Nov20 49:18 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock root 2797 0.2 0.3 1502964 56640 ? Ssl Nov20 21:24 mosquitto -c /etc/mosquitto/mosquitto.conf
Same issue here, and the strangest think it's the issue started 5 days ago by itself (I haven't done any update in the last 10 days).
Homeassistant container is the one consuming the memory:
I tried to update HA core today but didn't fix the issue.
Same here, i have a basic setup in Proxmox with Zwave and my memory use keep growing over about 4 days........... a reboot of HA does not fix it, only rebooting the VM will reset it.
You can see the reboot in the graph, then the steady climbing memory use
@dasher7320 looking at the memory reported by Proxmox is not a very accurate method of checking the memory used, as a VM will typically reserve all the memory assigned to it, but that doesn´t mean the memory is actually being used. A better method is checking the memory reported by Home Assistant (rr use the integration "System Monitor" that creates multiple sensors, including the memory used: https://www.home-assistant.io/integrations/systemmonitor)
@heisenberg2980 Thanks for the tip, i have added the stats and yes the memory use on Proxmox is currently 3.08 of 4gb, yet HASS is showing 925mb (23%) so who know why it is so different..............
