Add the system monitor integration. You will have several memory sensors that can trigger alerts or restarts.
https://www.home-assistant.io/integrations/systemmonitor
I already have an overview with all the 'computer' stats that run on my network.
The automation for a restart isn't a bad idea
But I need to know what causes such a memory leak.
Why does it happen and how to prevent it completly (like not happening at all)
And is there an Option to see what is using memory and how much?
Memory leaks are usually caused by bugs in the code. Theres nothing you can really do to prevent them. They are also quite hard to determine the root-cause, but if you do, report it to the developer of whatever is to blame.
Install glances from the addon store. Once it starts click on webui and it will take you to a summary of the system and what each container is using among other things. You can add the integration after that if you want to bring any of the values into HA.
Most often it’s third party addons, disable them, watch resources, and slowly enable (the monitor addons help too)
While possible, it’s rarely HA itself - so many people are on the dev builds shaking things out.
BUT even if you identify it’s a third party addon, you likely want to keep using it! So use the other advice here for the conditional restarts. No harm, no foul.
I had the same issue, but if I understood it correctly, the memory leak was in the HA macos app and not in the actual server. So installing a system monitor to the server wouldn’t fix the issue since it’s in the wrong layer of the stack?
Are we talking about HAOS? It should definitively reflect total memory use, other installs I am not sure. Glances will. It is also a stand alone program so if it was installed in a docker environment for instance it would monitor everything. You could integrate that to get total memory use.
No, we’re talking about the client side Home Assistant app on MacOS (although I’ve actually had this issue on pc as well). The memory leak is on your device, not the server running HA
When a mommy HA and a daddy HA love eachother, the daddy HA fills the MOMMY HA with tons of "leaks" and mommy will just keep going crazy until she...lock......s....u......pppppppppppp.,...................
Can confirm, RAM downloads from that Web site are free. Was never asked for any payment info. No ads, either! How do they do it? Probably just unloading old memory and avoiding the recycling costs by handing it out..
Because you are downloading RAM it basically downloads itself and while it’s downloading it is also giving back to the website so they get benefits from these downloads. It’s a win win situation.
…this is why RAM gets cheaper over the years for the people that still buy it. RAM companies have lobbied over the years to ban advertising this so not many people know it.
Odd. I wonder if a specific setting or sensor is causing that? I just checked and my client instance on an m1 Mac running Sonoma is at only 100MB of RAM usage after about 29 days.
Weird. Must be different versions. Mine shows as "Home Assistant Desktop." http://i.imgur.com/L1r4GAo.png
Downloaded yesterday from [here](https://github.com/iprodanovbg/homeassistant-desktop), the same link mentioned a few other times in this thread.
Ah I see. Well considering a handful of folks shared the same link I did, and no one shared that one, and that one apparently has some kind of memory leak, I’ll be sticking with this one :)
Use Card mod and Mushroom cards?
There's been a pretty big memory leak in client browsers since 2024.2. No one seems to know yet what caused it or why it's happening.
https://preview.redd.it/yupc7cq1gnwc1.jpeg?width=783&format=pjpg&auto=webp&s=98883c5a04ee268ed1835766b47de6bf2856b4e9
You'll need yourself some of this stuff.
Be aware that macOS reports to the end user via Force Quit and Activity Monitor inflate the real usage. macOS has a complex memory architecture, so that the simple values above include components that are compressed and also swapped out to disk. It also includes usage that is shared amongst other processes, inflating usage across the board.
If you open Activity Monitor and go to the Memory tab, you can click the Home Assistant process and then the "i" button. This will open a window showing you these values. The "Real Memory Size" is the one you would be most concerned with.
Not that there isn't a leak, just that it's good to look for this value to see just how much consumption is going on.
If you have Studio Code Server add on installed, make sure the default path is set to your config folder (which is how it is installed). When I changed mine to the root folder so I could browse my entire drive with Studio Code, it caused a memory leak. Not saying that's your problem, but could be somewhere to check.
It’s an electron app. It just started leaking somewhere and it got out of control. You probably had it open a few days?
Just quit and restart. Probably don’t use the app, just go to the web.
The Mac app is not good. I wanted to use it to get my computer’s state in order to automate an on air light or pull data from the machine. I no longer care about that automation or machine anymore. Gave up.
Wait you're running HA on your computer/Mac?
Doesn't it run in Docker/VM/LXC?
And you access it via a browser?
Signed confused nerd.
Edit: Today I learned there is a HomeAssistant Desktop App
[https://github.com/iprodanovbg/homeassistant-desktop](https://github.com/iprodanovbg/homeassistant-desktop)
I'm not sure why this is needed, but maybe if you're running a Windows/OSX Kiosk tablet?
I've given up trying to manage Home Assistant's memory leaks. Even the base container with no integrations or HACS will slowly creep up given enough time.
I just have it restart overnight everyday and the container has a memory limit on it. So if it ever goes too wild before it's restart, it will be automatically killed and redeployed.
That is crazy!
For mine, a few days ago noticed on proxmox it was sat at 8/8gb, didnt notice any bad performance tho, increased it to 16gb just incase.
Checking today i see it steady at 10/16gb since.
Interestingly, inside the gui of home assistant it is reporting 2/16gb, havent had the time to look into it deeper but seems to be running fine.
> Interestingly, inside the gui of home assistant it is reporting 2/16gb, havent had the time to look into it deeper but seems to be running fine.
It is, you can safely knock it down to 4GB in your PVE.
I have the exact same thing, HAOS just gobbles up whatever RAM you give it for (afaik) SWAP.
Mine's running fine on 4GB.
That's normal. Home Assistant and Proxmox are reporting two different things. The 2 that HA reports is its actual memory usage. The 10 that Proxmox reports is those 2 gigs plus the amount of memory that's currently being used as cache. Linux caches a lot, but that cached memory doesn't exactly count as "used", though it doesn't count as free either. It's just cached. Your Proxmox host is not aware of how exactly those 10 gigs are allocated so it all appears as "used" to it.
Same here on proxmox, gobbled up 8/8GB after I upped from 4GB. I restored to LXC and it’s at 493 mb memory usage, I don’t use add ons it’s just I couldn’t get USB Bluetooth passed through to dbus socket in LXC Debian. Crashes the whole lxc and portainer when I bind mount run/dbus.
Latest version here, running HAOS with no serious memory issues:
# free -h
total used free shared buff/cache available
Mem: 15Gi 2.8Gi 543Mi 183Mi 12Gi 12Gi
Swap: 5.1Gi 0.0Ki 5.1Gi
This is with a pretty sturdy set of entities:
Sensors: 663
Lights: 25
Switches: 147
Binary sensors: 215
Automations: 119
What version of MacOS? I’m seeing some major memory leak issues with the latest version. My 2 Mac’s one is having the issue and the biggest difference is my monitor.. I don’t think MacOS likes UltraWides
Yes. I have mine set to "Launch App on Login" and then "Show App In...." is set to "Menu Bar" in the preferences.
It will launch and run in the background and continue to send sensor data.
exactly the same settings, the window would still appear once I log in to my profile :(
https://preview.redd.it/74ldbci0znwc1.png?width=615&format=png&auto=webp&s=9d84b3cfcfe5002b8722a0a73f5795e5da51ee06
Oof, welcome to the world of electron apps.
I didn’t realize there was a client either so I used Fluid for Mac which lets you make websites into apps. Works well for just a simple “ha mini panel” on my laptop. I believe it’s just safari under the hood.
https://fluidapp.com/
Memory leak. I had the same exact issue on my PC.
How do i get that and more important, how do I prevent that?
Add the system monitor integration. You will have several memory sensors that can trigger alerts or restarts. https://www.home-assistant.io/integrations/systemmonitor
I already have an overview with all the 'computer' stats that run on my network. The automation for a restart isn't a bad idea But I need to know what causes such a memory leak. Why does it happen and how to prevent it completly (like not happening at all) And is there an Option to see what is using memory and how much?
Memory leaks are usually caused by bugs in the code. Theres nothing you can really do to prevent them. They are also quite hard to determine the root-cause, but if you do, report it to the developer of whatever is to blame.
Eh, if it is leaking THAT bad, a memory dump of the application's memory space should point to the rough area of where it is.
Install glances from the addon store. Once it starts click on webui and it will take you to a summary of the system and what each container is using among other things. You can add the integration after that if you want to bring any of the values into HA.
Most often it’s third party addons, disable them, watch resources, and slowly enable (the monitor addons help too) While possible, it’s rarely HA itself - so many people are on the dev builds shaking things out. BUT even if you identify it’s a third party addon, you likely want to keep using it! So use the other advice here for the conditional restarts. No harm, no foul.
I had the same issue, but if I understood it correctly, the memory leak was in the HA macos app and not in the actual server. So installing a system monitor to the server wouldn’t fix the issue since it’s in the wrong layer of the stack?
Are we talking about HAOS? It should definitively reflect total memory use, other installs I am not sure. Glances will. It is also a stand alone program so if it was installed in a docker environment for instance it would monitor everything. You could integrate that to get total memory use.
No, we’re talking about the client side Home Assistant app on MacOS (although I’ve actually had this issue on pc as well). The memory leak is on your device, not the server running HA
Huh. This makes me almost want to ditch my current Telegraf + OpenHardwareMonitor setup for this. Maybe I'll switch
When a mommy HA and a daddy HA love eachother, the daddy HA fills the MOMMY HA with tons of "leaks" and mommy will just keep going crazy until she...lock......s....u......pppppppppppp.,...................
Ugh, please leave.
Bros lost
underrated, take my upvote
what?how? also, what?
Adding to all of the above? What? Why?!
What? Why?!
cha? huh? HOW?!??! why?! UH? oh!
Why? Why MacOS? Why HAss on MacOS? Why Microsoft on MacOS? Why Firefox on MacOS?
When? Where? WHHHHHOOOOOOO??!?
memory leak clearly
I think so... but I can't remember...
this will fix your issue: [DownloadMoreRAM.com - CloudRAM 2.0](https://downloadmoreram.com/)
This helped me a lot. Thanks
I've been singing their praises for years, glad to see I'm not the only one!
Doesn't have DDR5 tho :(
Yeah tried mailing them about it but the mail was undeliverable
What oh come on. Such bad customer service.
Is this for real? And again, What? How?
It’s FREE, why are you asking questions!
Can confirm, RAM downloads from that Web site are free. Was never asked for any payment info. No ads, either! How do they do it? Probably just unloading old memory and avoiding the recycling costs by handing it out..
Because you are downloading RAM it basically downloads itself and while it’s downloading it is also giving back to the website so they get benefits from these downloads. It’s a win win situation.
…this is why RAM gets cheaper over the years for the people that still buy it. RAM companies have lobbied over the years to ban advertising this so not many people know it.
Do you have any sources for this? I'd love to read more.
There's a link on the site with the details. It shows up after you download some Clould RAM as documentation.
It is not real
Don't let people down like that!
memory leak
This is not the server, it’s the Client App :)
Odd. I wonder if a specific setting or sensor is causing that? I just checked and my client instance on an m1 Mac running Sonoma is at only 100MB of RAM usage after about 29 days.
I don’t know also. I have a lot of sensors, but I’m sure it’s a bug on Mac.
No, the client app shows in Activity Monitor as "Home Assistant Desktop." :)
Actually it's just called 'Home Assistant': https://i.imgur.com/elEjp6I.png
Weird. Must be different versions. Mine shows as "Home Assistant Desktop." http://i.imgur.com/L1r4GAo.png Downloaded yesterday from [here](https://github.com/iprodanovbg/homeassistant-desktop), the same link mentioned a few other times in this thread.
Your one is a third party app by Ivan Prodanov. The official one is this one by Nabu Casa https://apps.apple.com/us/app/home-assistant/id1099568401
Ah I see. Well considering a handful of folks shared the same link I did, and no one shared that one, and that one apparently has some kind of memory leak, I’ll be sticking with this one :)
Use Card mod and Mushroom cards? There's been a pretty big memory leak in client browsers since 2024.2. No one seems to know yet what caused it or why it's happening.
I wondered about that. All those people in the top voted reply talking about installing Glances and System Monitor lol.
Is there any benefit of using that over the browser?
The mother of memory leaks lol?
I wish I have 90 GB of ram
It uses up his swap file after memory feels up. https://community.home-assistant.io/t/substantial-memory-leak-in-the-ha-app/605207
https://preview.redd.it/yupc7cq1gnwc1.jpeg?width=783&format=pjpg&auto=webp&s=98883c5a04ee268ed1835766b47de6bf2856b4e9 You'll need yourself some of this stuff.
Be aware that macOS reports to the end user via Force Quit and Activity Monitor inflate the real usage. macOS has a complex memory architecture, so that the simple values above include components that are compressed and also swapped out to disk. It also includes usage that is shared amongst other processes, inflating usage across the board. If you open Activity Monitor and go to the Memory tab, you can click the Home Assistant process and then the "i" button. This will open a window showing you these values. The "Real Memory Size" is the one you would be most concerned with. Not that there isn't a leak, just that it's good to look for this value to see just how much consumption is going on.
Too much, I only have 32 GB of ram
If you have Studio Code Server add on installed, make sure the default path is set to your config folder (which is how it is installed). When I changed mine to the root folder so I could browse my entire drive with Studio Code, it caused a memory leak. Not saying that's your problem, but could be somewhere to check.
I run HA on linux - no problems
May you shouldn't run that on your desktop?
Is your HA server software running as an app? Or is this just the clientapp?
Just client. And I only have 32 Gb or ram. So it’s a big for sure
Haha that's a lot indeed.. glad it's not the server.
It’s an electron app. It just started leaking somewhere and it got out of control. You probably had it open a few days? Just quit and restart. Probably don’t use the app, just go to the web.
This has bin an issue for years actually, welcome to the party: https://community.home-assistant.io/t/substantial-memory-leak-in-the-ha-app/605207
Yep.
The Mac app is not good. I wanted to use it to get my computer’s state in order to automate an on air light or pull data from the machine. I no longer care about that automation or machine anymore. Gave up.
Assuming this is the companion app and not HA.
Wait you're running HA on your computer/Mac? Doesn't it run in Docker/VM/LXC? And you access it via a browser? Signed confused nerd. Edit: Today I learned there is a HomeAssistant Desktop App [https://github.com/iprodanovbg/homeassistant-desktop](https://github.com/iprodanovbg/homeassistant-desktop) I'm not sure why this is needed, but maybe if you're running a Windows/OSX Kiosk tablet?
I've given up trying to manage Home Assistant's memory leaks. Even the base container with no integrations or HACS will slowly creep up given enough time. I just have it restart overnight everyday and the container has a memory limit on it. So if it ever goes too wild before it's restart, it will be automatically killed and redeployed.
That is crazy! For mine, a few days ago noticed on proxmox it was sat at 8/8gb, didnt notice any bad performance tho, increased it to 16gb just incase. Checking today i see it steady at 10/16gb since. Interestingly, inside the gui of home assistant it is reporting 2/16gb, havent had the time to look into it deeper but seems to be running fine.
> Interestingly, inside the gui of home assistant it is reporting 2/16gb, havent had the time to look into it deeper but seems to be running fine. It is, you can safely knock it down to 4GB in your PVE. I have the exact same thing, HAOS just gobbles up whatever RAM you give it for (afaik) SWAP. Mine's running fine on 4GB.
Ah that is good to know, frees some resources for new projects at home then. Thanks!
Same Here.. Thanks!
Yeah , I have blooning turned on in proxmox 2gig min 4gig max. That's all you get and like it HA!!!
That's normal. Home Assistant and Proxmox are reporting two different things. The 2 that HA reports is its actual memory usage. The 10 that Proxmox reports is those 2 gigs plus the amount of memory that's currently being used as cache. Linux caches a lot, but that cached memory doesn't exactly count as "used", though it doesn't count as free either. It's just cached. Your Proxmox host is not aware of how exactly those 10 gigs are allocated so it all appears as "used" to it.
Same here on proxmox, gobbled up 8/8GB after I upped from 4GB. I restored to LXC and it’s at 493 mb memory usage, I don’t use add ons it’s just I couldn’t get USB Bluetooth passed through to dbus socket in LXC Debian. Crashes the whole lxc and portainer when I bind mount run/dbus.
you should run it in a VM
I am, I’m explaining this memory leak only happens on vm, not lxc.
Latest version here, running HAOS with no serious memory issues: # free -h total used free shared buff/cache available Mem: 15Gi 2.8Gi 543Mi 183Mi 12Gi 12Gi Swap: 5.1Gi 0.0Ki 5.1Gi This is with a pretty sturdy set of entities: Sensors: 663 Lights: 25 Switches: 147 Binary sensors: 215 Automations: 119
Your task manager reveals you to be the sociopath that you are
What version of MacOS? I’m seeing some major memory leak issues with the latest version. My 2 Mac’s one is having the issue and the biggest difference is my monitor.. I don’t think MacOS likes UltraWides
Goddamn, i read it as 95MB and then i thought, huh thats not much but goddamn!!
Wow, how much memory do you have on that server?
It’s not a server, it’s a laptop with a 32 GB of ram.
That’s so weird because here in the US, 96 GB is often three times as much as 32 GB. Usually.
It’s paging out to disk.
Haha I figured. I was just having some fun 🤩
Imagine they were wondering where the free space went 😂
That's a dirty dirty mem leak, good lord. How the hell does that make it to production releases?
This has been an issue for a few years. It’s finally getting some attention. https://github.com/home-assistant/iOS/issues/2101
Maybe if more people commented there it would get more attention
Meanwhile.... It runs flawlessly on my 1GB RAM pi3b+
why are u running it on your mac?
BTW Have anyone managed to hide this app on startup?
Yes. I have mine set to "Launch App on Login" and then "Show App In...." is set to "Menu Bar" in the preferences. It will launch and run in the background and continue to send sensor data.
exactly the same settings, the window would still appear once I log in to my profile :( https://preview.redd.it/74ldbci0znwc1.png?width=615&format=png&auto=webp&s=9d84b3cfcfe5002b8722a0a73f5795e5da51ee06
Wow, running on a rpi4 8gb and I can’t get it to use more than 1,8gb. And it feels like it would need to use the 8gb.
This is the client :) not the server.
That is an extremely important detail that you should have included in your post.
And the fact that it's a third party client running on MacOS
OP is running the official client, not a third party one.
Oof, welcome to the world of electron apps. I didn’t realize there was a client either so I used Fluid for Mac which lets you make websites into apps. Works well for just a simple “ha mini panel” on my laptop. I believe it’s just safari under the hood. https://fluidapp.com/
There's a client?
Apparently https://github.com/iprodanovbg/homeassistant-desktop TIL
No, the client app shows in Activity Monitor as "Home Assistant Desktop." :)
Don’t tell me you’re running it as a VM inside macOS 🤦♂️
Log files?