Two potential options are to write some code to use objgraph to dump every object in memory every 30 seconds and see where the growth is, or remove integrations one by one until the issue goes away.
well, yeah, was afraid it would be the response I have like 30 integrations (and of course some integration, like mqtt, are part of the core of my automation) and I need at least 12 hours to figure out if there is a memory leak.
Anyway, thanks for the response, Iām gonna start with the less important one !
Reducing add-ons helped me.
Hi Brian
Did you notice a difference in behaviour after shifting to a supervised VM?
Iāve been struggling with high memory usage for some months now. Iām running supervised HA on RPi3b+ running Raspbian. I really canāt track down the root cause for increased memory usage but it started this summer. Everything worked fine for months before thatā¦
Iāve tried numerous of things to resolve this issue but nothing seemed to help until this. I increased cache size to twice the size of the RAM available on RPi3b+. After this RAM and cache usage has been steady. I havenāt seen the constant increase in cache and RAM usage that used to be the case before increasing the cache size. I know this might be killing my SDcard but itās better than daily forced reboots. Maybe I need to migrate my setup to SSD boot.
I would recommend SSD boot setup, itās pretty easy to do nowadays and the speed difference is noticeable.
Hi, I have noticed the memory consumption related to nodeRed. The more automation, especially the subprocesses in subproces, the faster the RAM clogs up.
Try to restart Node Red, if you memory the consumption will be close to 100%
For me, the memory consumption - 6Gb takes about 5 days
Is it possible to do an automatic restart in proxmox for an hour, e.g. 02:00?
Iāve created a container and installed Node-Red directly on that. Moved all flows off HA add-in that do not interact with HA directly on to the LXC.
Iāve done the same for Mosquitto (MQTT) and it runs in its own LXC.
The separate LXCs make a much better job of memory management IME.
is there an instruction on how to install it on proxmox?
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
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.
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.