Home Assistant - High Memory Usage

I’m seeing high RAM usage after the update to HASSOS 7.5.
Before the update today it hovered around 1.6GB used. After the update it’s stable around 2.9GB.

It’s almost doubled RAM usage with this update.
That seems a bit excessive…

I’m on 6.6. My ram (4gb) is stable utilized by around 50% and the swap (2gb) around 25%.sometimes 35% and sometimes 20% depending on my development activity. As lond as this is stable it do not bother me in detail how much memory is used. Ram usage is good as it is the fastest way keeping data in fast access.

I’ve increased the RAM from 3 to 4GB in proxmox and it’s just increased it’s usage to the new level.
It’s now hovering at 3.5GB used.
does anybody have an idea what could be going on here?

have the same, only on a Raspi 3b+ with only 1gb of RAM. :smiley:
So its constantly at >80%, and freazing every day, although I already increased swap size.

1 Like

I just downgraded to 7.4., worked perfectly. Obsviously I don’t know if it really fixed the ram issues, gonne see the next day.
If anyone else want to test:

ha os update --version 7.4

using the Home Assistant Community Add-on: SSH & Web Terminal

Update: still bogging down

I seem to have this high memory usage problem too, it constantly stays above 70% use (swap always near 100%) on a RPi4b with 2gb ram. OS 7.5, Core 2022.3.8, Supervisor 2022.03.5

I only noticed it when I’m trying to upload to esp devices using ESPHOME – my HomeAssistant would hang and become unresponsive. I’m not really sure when this started to happen though.

Would this have anything to do with switching from SD card to SSD?

edit: it seems the update today (April 1) with OS 7.6 does not change anything …

edit 2: I had to restore to a December backup to get HA back to a useable state. I could have sworn that when idling, swap was real low … around 0%. But as I was bringing things back up to date, I noticed that the swap came back up to 30-35% and ram at 65% while idling after switching from the deprecated esphome add-on to the current one.

At 65%/35%, everything seems to work fine still but it idles at that level and I’m not sure if that’s normal?

What fixed daily (sometimes even twice) hangups for me is going back to OS 6.6 - it seems that everything beyond that makes my poor RPi 3b+ die in a matter of hours :frowning:

FWIW, if you want to try, you don’t need to restore from a backup (certainly helps to have one, in case anything goes wrong):

ha os update --version 6.6

1 Like

I might have to give that a try … I just noticed that swap has slowly gone up to 75% now. Not even sure when that started happening.

Do I run that within the community based ssh/terminal add-on? Or separate instances from putty?

edit::Rolling back to OS 6.6 didn’t seem to change anything unfortunately …

is there no fix for this?
Or is this a problem with my own setup? Something in my config is causing the high memory usage?

edit: With no changes on my part to my system other than upgrading to Core 5.0 and then 5.1, it’s a steady 10% CPU usage, 60% Ram and 20% Swap.

I recently noticed that my Proxmox HASS VM also would start with low ram use after a host reboot but within 24 hours would be using ~90% available ram. I kept allocating more RAM to the VM but it just kept increasing as I did so.

I read the majority of these community posts trying to figure it out, then happened to notice in my logs a lot of DEBUG lines. I had turned on debugging a long time ago using the logger yaml config for something, and even though I had subsequently commented those lines out from my config, it seems like commenting alone did not set it back to default. After enabling logger again and setting the default level to warning, it’s now been 24 hours and my RAM usage is just slightly above where it settled in after the host reboot.

Maybe useful to others to check this if other causes have been exhausted.

2 Likes

Thanks, i pass from 98% to 44 % of ram (2go) used with your tips :wink:

Hi someone found a solution for the problem with proxmox… I tried the solution for the logger
Still nothing helping

Using HA in Docker (not HassOS), debian.
Facing huge CPU load by python3 very often. Usually have to reboot the host.

I am a novice with py-spy.
How to run py-spy and get an info which parts of HA cause the CPU load?

What I did is:

sudo apt update 
sudo apt install python3-pip #installing pip
pip install py-spy #installing py-spy

Now I need to run smth like:

py-spy record -o profile.svg --pid 12345

but the program’s pid must be in the container’s context, right?
Means - I need to run py-spy inside the HA container. But the command is “not found” when called in bash:

sudo docker exec -it HA /bin/bash  ##entering "to container"
top #getting a list of processes
py-spy top --pid 63  #and this command not found

Hi there,

I had the same issue since version 10 of the homassistant os. So the problem is probably still relevant.
It was so bad that I could no longer use homeassistant.
For me it worked when I downgrade via ssh to version 9.5.

ha os update --version 9.5

I hope there will be an update of homeassistant os soon, which will fix this problem.

My RAM always increase by time. After a reboot it starts from the bottom again.

Any solutions for this problem? It seems that I’m not alone with this.

I’m using Proxmox.

I’m on the same boat, I started out with the minimum requirement of 2GB, after it filled that I assumed I needed some more so went with 4GB, which it ate up in a couple of days, now it’s at 6.73/8GB (and rising).

Also using Proxmox.

What gives?

EDIT - just seen @ryanupp’s comment and I had also enabled debugging a long time ago but commented the lines out assuming it would return to default.
I’ve re-set them back to warning and rebooted, currently at 2.13/8GB, will see if that sorts it out.

Unfortunately RAM usage still appears to be on the rise, with a random sudden increase of about 100%…

Is there a way I can see what is using the RAM inside HassOS?

Just set up HA in a HassOS container in Proxmox. I haven’t set up any integrations or even logged in yet and it’s already using 94% of the 4GB I gave it. Is this normal?

That’s funny… I have HA running on a Raspberry PI3A+ with 512Mb of Ram… with some addon (not many) and it uses about 85% of its Ram…

What Proxmox reports and what HA is actually using can be widely different. You need to look at resource utilisation inside HA to get an accurate figure.