hass-browser_mod: [Bug]: Memory Leak in browser_mod Leads to Edge Crash in Kiosk Mode

My Home Assistant Version

Installation method Home Assistant OS Core 2025.6.1 Supervisor 2025.06.1 Operating System 15.2 Frontend 20250531.3

What I am doing

When using browser_mod (v2.4.0) on a Microsoft Surface Pro 5 running a single Microsoft Edge window/tab in kiosk mode, memory usage gradually increases over ~48 hours until the browser tab crashes with an “out of memory” error. After the crash, memory usage immediately returns to baseline (~37%), suggesting a memory leak tied to browser_mod.

Image

What I expect to happen

Memory usage should remain stable over time, especially with no dashboard interaction.

What happened instead

No response

Minimal steps to reproduce

Surface Pro 5 with 8GB RAM, Edge browser in kiosk mode. No extensions.

Home Assistant dashboard open with browser_mod enabled

Wait 24-48 hours (no interaction needed)

Observe system RAM usage rising to ~75% and browser crash

After crash, system RAM drops back to initial levels

I took heap snapshots; Promise objects with retainers in browser_mod.js grow over time.

It’s unclear if this is due solely to browser_mod or interaction with other cards it modifies (e.g., button-card, mod-card). However, with browser_mod disabled and all else unchanged, the issue does not occur.

Please let me know if more debug info or heap snapshots would help.

Image

an example promise:

3inGenerator@1126647browser_mod.js?2.4.0:82 15 0.1 kB0 % 0.1 kB0 % extensioninsystem / Context@1126635 14 0.0 kB0 % 0.2 kB0 % contextin()@1126633 13 0.0 kB0 % 0.0 kB0 % 1insystem / PromiseReaction@1126651 12 0.0 kB0 % 0.8 kB0 % reactions_or_resultinPromise@1126717 11 0.1 kB0 % 0.9 kB0 % 1insystem / Context@1126719 10 0.0 kB0 % 0.9 kB0 % contextin()@1076857 9 0.0 kB0 % 0.9 kB0 % [1]inV8Function@129128 8 0.0 kB0 % 1.0 kB0 % [2]inScheduledAction@94064 7 0.1 kB0 % 1.0 kB0 % [1]inDOMTimer@94062 6 0.2 kB0 % 1.2 kB0 % [2]inInternalNode@94070 5 0.0 kB0 % 20.5 kB0 % [1]inInternalNode@17032 4 0.0 kB0 % 20.5 kB0 % [4]inInternalNode@84060 3 0.0 kB0 % 21.0 kB0 % [30]inWindow@127671 2 0.9 kB0 % 39.0 kB0 % <symbol V8PrivateProperty::CachedAccessor::kWindowProxy>inWindow / homeassistant.local:8123@7501 1 32.7 kB0 % 28,805 kB34 % globalThisinWindow / homeassistant.local:8123@7501 1 32.7 kB0 % 28,805 kB34 % global_proxyinWindow / homeassistant.local:8123@7501 1 32.7 kB0 % 28,805 kB34 % Fpinsystem / Context@351683 4 5.0 kB0 % 494 kB1 % Mdinsystem / Context@351683 4 5.0 kB0 % 494 kB1 % Pbinsystem / Context@351683 4 5.0 kB0 % 494 kB1 % Xrinsystem / Context@351683 4 5.0 kB0 % 494 kB1 % [21]inHTMLDocument@127669 2 3.3 kB0 % 416 kB0 % [35]inHTMLDocument@127669 2 3.3 kB0 % 416 kB0 % Peinsystem / Context@393519 4 0.9 kB0 % 402 kB0 % tinsystem / Context@393519 4 0.9 kB0 % 402 kB0 % teinsystem / Context@393519 4 0.9 kB0 % 402 kB0 % [10]inInternalNode@10400 3 0.0 kB0 % 287 kB0 % [22]inInternalNode@10400 3 0.0 kB0 % 287 kB0 % Feinsystem / Context@337733 4 0.8 kB0 % 253 kB0 % Sinsystem / Context@337733 4 0.8 kB0 % 253 kB0 % xtinsystem / Context@337733 4 0.8 kB0 % 253 kB0 % [5]inCustomElementRegistry@127771 3 0.1 kB0 % 137 kB0 % einsystem / Context@387393 6 1.0 kB0 % 92.4 kB0 % einsystem / Context@361175 6 0.7 kB0 % 83.2 kB0 % wiinsystem / Context@361175 6 0.7 kB0 % 83.2 kB0 % giinsystem / Context@376997 6 1.0 kB0 % 78.4 kB0 % ttinsystem / Context@376997 6 1.0 kB0 % 78.4 kB0 % global_proxy_objectinsystem / NativeContext@7499 3 1.2 kB0 % 69.1 kB0 % einsystem / Context@399485 7 0.5 kB0 % 54.7 kB0 % ptinsystem / Context@371119 6 0.5 kB0 % 43.7 kB0 % [21]inWindow@127671 2 0.9 kB0 % 39.0 kB0 % [23]inWindow@127671 2 0.9 kB0 % 39.0 kB0 % t$2insystem / Context@408785 7 0.5 kB0 % 34.8 kB0 % Vinsystem / Context@387085 7 0.4 kB0 % 32.3 kB0 % Rinsystem / Context@170753 7 0.5 kB0 % 29.9 kB0 % iinsystem / Context@409321 6 0.4 kB0 % 22.0 kB0 % $def2de46b9306e8a$var$tinsystem / Context@368895 6 0.4 kB0 % 20.5 kB0 % [2]inInternalNode@17032 4 0.0 kB0 % 20.5 kB0 % ainsystem / Context@803281 9 0.4 kB0 % 20.0 kB0 % Wtinsystem / Context@393797 6 0.4 kB0 % 17.1 kB0 % ninsystem / Context@393797 6 0.4 kB0 % 17.1 kB0 % Zinsystem / Context@392083 7 0.4 kB0 % 17.0 kB0 % pinsystem / Context@417387 3 0.1 kB0 % 15.3 kB0 % rinsystem / Context@417387 3 0.1 kB0 % 15.3 kB0 % tinsystem / Context@625451 7 0.4 kB0 % 13.8 kB0 % Ninsystem / Context@493399 7 0.4 kB0 % 12.4 kB0 % iinsystem / Context@368727 6 0.3 kB0 % 12.0 kB0 % iinsystem / Context@486341 5 0.3 kB0 % 11.5 kB0 % qinsystem / Context@518731 6 0.5 kB0 % 10.2 kB0 % einsystem / Context@404567 7 0.3 kB0 % 9.9 kB0 % Zinsystem / Context@517539 7 0.2 kB0 % 7.2 kB0 % ginsystem / Context@409005 6 0.2 kB0 % 5.5 kB0 % [14]inHTMLDocument@6 3 3.3 kB0 % 5.0 kB0 % einsystem / Context@410855 3 0.1 kB0 % 4.3 kB0 % tinsystem / Context@572491 3 0.4 kB0 % 3.6 kB0 % Oinsystem / Context@367233 6 0.2 kB0 % 3.1 kB0 % tinsystem / Context@818843 7 0.3 kB0 % 2.9 kB0 % [1]inNavigation@10344 3 0.1 kB0 % 1.3 kB0 % ainsystem / Context@158911 7 0.1 kB0 % 1.2 kB0 % finsystem / Context@901755 9 0.1 kB0 % 1.0 kB0 % sinsystem / Context@663111 3 0.1 kB0 % 0.5 kB0 % [2]inScheduler@13114 4 0.2 kB0 % 0.4 kB0 % oinsystem / Context@931923 9 0.1 kB0 % 0.4 kB0 % [1]inScriptedAnimationController@10394 3 0.2 kB0 % 0.2 kB0 % [1]inServiceWorkerContainer@10510 4 0.2 kB0 % 0.2 kB0 % [1]inScriptedIdleTaskController@44472 4 0.1 kB0 % 0.1 kB0 % [38]inLocation@127907 3 0.1 kB0 % 0.1 kB0 % ainsystem / Context@691207 8 0.0 kB0 % 0.0 kB0 % ninsystem / Context@322663 8 0.0 kB0 % 0.0 kB0 % [1]inVisualViewport@32550 3 0.0 kB0 % 0.0 kB0 % ainsystem / Context@692705 8 0.0 kB0 % 0.0 kB0 % [1]inViewport@32552 3 0.0 kB0 % 0.0 kB0 % [2]inInternalNode@18112 4 0.0 kB0 % 0.0 kB0 % ainsystem / Context@691117 8 0.0 kB0 % 0.0 kB0 % ainsystem / Context@691077 8 0.0 kB0 % 0.0 kB0 % bound_thisinnative_bind()@156661 10 0.0 kB0 % 0.0 kB0 % bound_thisinnative_bind()@754011 7 0.0 kB0 % 0.0 kB0 % bound_thisinnative_bind()@582225 7 0.0 kB0 % 0.0 kB0 % ninsystem / Context@938483 9 0.0 kB0 % 0.0 kB0 % ninsystem / Context@358289 8 0.0 kB0 % 0.0 kB0 % ninsystem / Context@322383 8 0.0 kB0 % 0.0 kB0 % ninsystem / Context@322321 8 0.0 kB0 % 0.0 kB0 % ainsystem / Context@691295 8 0.0 kB0 % 0.0 kB0 % ninsystem / Context@322825 8 0.0 kB0 % 0.0 kB0 % thisinsystem / Context@416275 5 0.0 kB0 % 0.0 kB0 % exportsin{exports}@938047 6 0.0 kB0 % 0.0 kB0 % exportsin{exports}@938005 6 0.0 kB0 % 0.0 kB0 % exportsin{exports}@936703 6 0.0 kB0 % 0.0 kB0 % valueinsystem / PropertyCell@432073 3 0.0 kB0 % 0.0 kB0 % valueinsystem / PropertyCell@417439 3 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@59430 5 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@15664 5 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@145272 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@32542 5 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@32546 3 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@66310 3 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@73548 3 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@13112 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@12020 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@18128 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@18120 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@15670 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@18114 4 0.0 kB0 % 0.0 kB0 % [1]inInternalNode@52660 6 0.0 kB0 % 0.0 kB0 % Show all 37 contextin()@1126653 13 0.0 kB0 % 0.0 kB0 % 2in(internal array)[]@1769995 16 0.0 kB0 % 0.0 kB0 % <symbol>inPromise@1126639 13 0.0 kB0 % 0.0 kB0 % 0insystem / PropertyArray@1126643

Include any yaml code here


Error messages from the browser console


By checking each box below I indicate that I …

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
  • Have made sure I am using the latest version of the plugin.
  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.
  • If this issue is to do with an Android device losing connection, sensors becoming unavailable etc., please confirm you have read, understood and tried methods described in Wiki Article Andoird Devices ‘Always On’

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

Hi, thanks for the detailed explanation — that makes a lot of sense based on what I’ve been observing during testing.

Your description of a Promise never settling and running on a loop matches closely with what I was seeing during heap analysis in Edge DevTools.

I’ve not yet tested setting ‘allow_nested_more_info: false’, but based on your diagnosis, I’ll implement that configuration shortly and monitor memory behavior again under the same conditions.

Once I’ve completed a full test cycle with that setting, I’ll report back here with results.

Appreciate the quick response and thorough investigation — I’ll follow up once the next round of tests are done 🙂

Interesting, thank you. Regarding No 1 - Looking at my popup cards, which don’t pop up automatically, but via a button press on my dashboard, I do have 3 popups which contain graphs. One uses apexcharts for 2 sensors, showing my upload and download internet speeds spanning the past 24 hours. Another popup has 2 mini-graph cards, one for CPU usage and one for CPU Temp for my host machine, spanning 24 hours. My 3rd popup has an energy-usage-graph using default settings.

I’m happy to upgrade to 2025.6.3 just to rule that issue out. In the meantime, it’s too early to tell whether the Kill Switch function has made any difference - I enabled it at tablet restart at 10am

Image

What I will do is update to 2025.6.3 now, then clear cache and leave it for a few hours and check the memory usage after that, which should give us a fully up to date baseline to work/check from.

Hi, thanks. In response to the points above:

  1. The Edge device is displaying a single dashboard page, with various custom_button_card buttons throughout. I have a custom:platinum-weather-card with animated weather icons, a picture-entity card which shows a static picture from my security camera, using a snapshot from teh stream which updates every 10 seconds. I have an automation which launches a popup window using Browser_mod when a person is detected or when the doorbell is rung. The live sub stream is shown in the popup using custom:webrtc-camera. This popup closes after a timer of 1 minute expires, if it isn’t closed manually.
  2. I was running this dashboard setup for nearly 24 months, having Edge update services disabled via Windows services, and a Windows firewall rule to block Edge updates in the background. Never had any problems with Edge crashing. I believe the crashing started happening a few months back, so probably a few Browser_Mod versions ago (possibly even at the start of the Phoenix version). I haven’t had time until now to try to dig into it, and simply refreshed the web page or restarted the tablet to get around the issue. Not helpful I know, and I started off trying to rule out any sort of browser incompatibility with the latest HA front end, due to many HA updates over the 24 months, and finally updated Edge to a much newer version, which made no difference.
  3. Yes, I’m referencing browser_mod in my config resources like this:
lovelace:
  mode: yaml
  resources:
    - url: /browser_mod.js?
      type: module

and the dev tools shows that 2.4.0 is being loaded successfully, which matches the Integration version I have. 4. Sure thing. I’ve updated to 2.4.1 this morning, cleared caches and restarted HA and the tablet. 5. I’ve also appended the ?disableBrowserModFrontendSettings Frontend kill switch so I will monitor today and see what happens with the memory usage and report back. I spotted a typo while checking out the documentation regarding the Kill Switch feature here: https://github.com/thomasloven/hass-browser_mod/blob/master/documentation/configuration-panel.md#frontend-settings-admin-only

Image

As I discovered using E instead of e doesn’t work - and should have used the string that you put in your reply above 😃