Home Assistant - High Memory Usage

Since the 12.x update, Home Assistant will run a python3 script that consumes 94% of my memory, essentially shutting down the system. I can log in and eventually enter my commands to stop Home Assistant or restart the computer, but it’s faster to just pull the plug and let it reboot.

I’m running on an Intel NUC with 8GB RAM, usian Debian Bookworm in a Docker container with Compose. The memory usage is definitely HA, because if I stop the container all systems function as normal. It takes about 12 hours before it locks up. I’m going to set a task to restart the system every 12 hours as a work-around.

I’m still investigating. The only other thing I added recently were some style templates.

1 Like

i have same behaviour on proxmox, but there is not difference in what proxmox is showing to HA VM inside.
after rebooting the vm it starts at around 1.5GB usage, slowly but steadily increasing, then suddenly a jump, again increasing, then a bigger jump to around 4GB and still increasing.
will let it run for a while now and see what happens next, when nearly 100% of the memory is in use.

as i’m not allowed to upload more than 1 image in a post, i added the “top”-output of HA OS here
image

Are you running HAOS or another variant like Supervised or Core.

Hi,
same here. I have the same setup, with proxmox and 4Gb RAM. Don’t know what is eating up all the Memory. I few month ago HA was running in a VM on my NAS with only 1GB memory. This ran fine. Maybe HA always eats up as much memory as it can…?

I’ve implemented the system monitor sensor and this shows other values.
Memory free and used

Can you share what method/guide you used to setup the VM and install HAOS. This is either an issue with your Proxmox setup or HAOS install.

I’m running HAOS as VM on proxmox.

Can you share a screenshot of the VM hardware and options pages.

This is my VM - hardware & options


Same here. I used the proxmox-helper-script.

I suggest to setup a new HA VM using my instructions. I also strongly suggest you use host and q35 settings to setup the VM. Please follow my guide and if you are using SSD select the right IO settings as per my guide. Then please le me know if you still experience the same issues.

alright, i’ve created a full backup of my HA-Instance and created a new VM following your guide - currently restoring my HA-backup in that machine.
what IO settings for SSD do you suggest? you mean enabling SSD emulation? any other SSD-related setting?

as i had that in the past already, also this time, the restore still shows up, but should be finished already. sadly the screen stays forever.

i reopened HA, but seems there are some more issues now, as my addons do not start anymore (MQTT broker,…) :frowning:
especially MQTT is important for me to connect to FHEM, my go-echarger,…

EDIT: so, i followed your guide again but instead of using a naked qcow i used a cloned disk of my previous home-assistant machine. so out of the raw-disk i created a qcow and imported it as bootdisk to the newly created VM.
so i just replaced the vm but not the homeassistant data.
seems to work so far. but will see if anything will change in the high-memory usage.


Suggested SSD disk settings:

image

You are running MQQT as an addo-on in HA or external. I suggest you run MQQT in its own LXC.

You will need to re-establish the MQQT connection with credentials. I believe restore will not apply the MQTT settings.

Additionally why don’t you use Proxmox for backing up the entire VM with a 4 month, 4 week and 4 day retention strategy.

Restoring HAOS cannot be easier than restoring the HA VM which takes minutes.

thx, confirmed - i have that
image

mqtt is running as addon in HA, so this was lost then, althouth restoring a full backup of HA (again learnt something new)
tbh, i’m a newbie when it somes to mqtt, so i went the easiest way and ran it as addon. maybe i’ll switch that another day - for now i’m happy that i didn’t destroy my setup.

yes, restoring HAOS is easy in general, i restored my whole proxmox host last week when i started a new proxmox server.
i’m super happy in general with proxmox, as it’s super powerful, and this all for free :+1:

Try my Mosquitto deployment (MQTT). It should take less than 5 minutes to deploy and you have an LXC which you can fully backup with Proxmox. Any HA add-on which can be run in its own KVM/LXC should.

i have backups in place for the whole system and tested restoring it - this is all not a problem, but i re-created the vm, following your guide, and stumbled across some issues then with my addons. but i got it working with creating qcow out of my “old-vm” and importing it to the new vm.

thanks a lot for your support here and the guide!

Please ensure this setting is applied:
image