Home Assistant - High Memory Usage

ok, it worked, here’s a link describing how to do it

1 Like

I’m finding memory usage creeps up quickly if I have a browser open on the Lovelace Dashboard. If I keep them closed memory doesn’t jump as quickly.

I switched from microsd to ssd boot anyway memory problems persist

1 Like

I solve this problem by calling

sysctl -w vm.drop_caches=1

in HassOS.

thanks to this article : https://codefresh.io/docker-tutorial/docker-memory-usage/

I just moved from RasPi3b to HA Blue (Odroid N2+) with 4 GB RAM after having had to restart HA every 2-3 (losing 100-200 MB memory per day). This started around Christmas, never had issues in the 9 months before that.

On the new setup I also see continuously dropping memory with steep downs when I have Lovelace open or working on the frontend (which also gets CPU and Memory of the browser on my client fired up).

So there seem to be issues related to the Frontend if that’s of any help. I will see if I‘ll spend hours tracking down the source of the memory leak now that I‘ve thrown some money at the problem…

Solved by increasing the swapfile size on RPi 3B by adding

init_commands:
  - if [ ! -f /backup/_swap.swap ]; then fallocate -l 2G /backup/_swap.swap && mkswap /backup/_swap.swap && chmod 0600 /backup/_swap.swap && swapon /backup/_swap.swap ; elif [[ ! $(dmesg|grep _swap.swap) = *swap\ on* ]]; then swapon /backup/_swap.swap; fi

in the config of SSH & Web Terminal add-on. Take a look at this github issue: https://github.com/home-assistant/operating-system/issues/968 or here in the community How to increase the swap file size on Home Assistant OS by JZhass

I’m running the latest version of HA on Proxmox (running on an i7 16G). I’ve just noticed on the Proxmox console a memory usage of 90% but in Home Assistant the sensor indicates a usage of less than 20%. Should I be worried ? And besides adding more memory (currently 8G), what are my options ?

Proxmox console will show you mostly always 90%. This is because it doesn’t know if the usage is for caching or not.
The best to do is go to the home assistant console and run first login to go to OS and then use free to know how much memory is available. If the available memory remains “constant” then don’t worry.

We had a memory increase problem back in October 2020, related to a Brother Printer integration. I’ve removed that integration from my set-up, and my memory increase has ceased to be a problem. It’s gone back to normal usage of around 980Mb.

1 Like

I had this issue a week or so ago and I came across your post. After removing the Brother Printer and IPP integrations, the problem is gone.

1 Like

The latest update to 2021.2.3 should have fixed this. You can add the integration back on again.

I’m having the same issues not sure if it reporting right or not. On hassio it show ram usage over 100%. That not over an long period of time. It reach that point pretty much with in 2 minute after each reboot up. On proxmox its hover around 3gb out of 4gb of allot ram. I have total of only 13 addon and only 11 is running 24/7.

However I do notice on hassio sometime does hang on page load up from time to time during me making new lovelace ui or just messing around with the config. Pretty much the page will take forever/hang to page refresh. I have to completely close the browser page and open an new one.


!

1 Like

I just installed glancs and it’s reading seem to be more realistic. Maybe hassio reporting does have some bug?

I’m running HA on Proxmox and I tried to get the nextcloud backup repo working. It kept failing on too big of a size, error 413.

So then I stated debugging Nextcloud which wasn’t the issue, Proxmox/HA was the issue. Whenever I ran the backup/snapshot I saw the memory spiking up to 8G of RAM and failing. Seems like HA writes to memory as temp folder and maybe not releasing it? Could this be the problem, especially for the Raspberry users?

Hi, I did that as well but did not solve the problem itself. It just gives time :slight_smile:
I can assist NamCisum as I recognized, that the memory drops down from 85% to 50% during the night. The swap file (2GB) drops down from 25% to 8% in the weekend to 5%.
And the ram started to increase exacly every morning around 07:30, the time when I start my notebook and open HA. It seems, regardless of closing HA or logoff, the memory increases up to 85% within the next two hours and then swaps out so that the swap utilization raises to 25%, each day a little more.
I’m running on 2021.3.4
image
image

Already opened an issue on GitHub.

I detect a direct relation between memory increase and start/shutdown my notebook.

that’s interesting, I will follow the issue on github…

I found that deleting old updates, addon and temporary installations that only take up disk space also frees up some memory, even though things shouldn’t be related…
just try with SSH & Web terminal addon in Disable Protection Mode with the commands

df 

docker system df –v

to monitor your overlay usage and with

docker image prune -a

docker volume prune

to clean you HA and check the memory usage. I had good a drop down.

2 Likes

Yes, the memory load dropped by 20% … Thank you!

Hi.
I’m having memory issues too.
Is there a way to find what is eating RAM?
3B+ and HA 2021.6.4 OS 6.0

Do you have deConz in use? Then open deconz (not Phoscon) and deactivate the display of LQI and neighbor links. That decreased memory and cpu usage rapidly here
image

PS: Dresden-Electronics promised an improved memory handling beside a general performance improvement for the next version which will be 6.10.x