slowlydev / f1-dash

A real-time F1 dashboard
https://f1-dash.com
GNU General Public License v3.0
396 stars 37 forks source link

Memory leaking on Firefox #108

Open voidlynx opened 1 month ago

voidlynx commented 1 month ago

Heya, big fan of F1-Dash. Unfortunately, it absolutely destroys my system's memory on Firefox. Experienced this on both my main desktop and laptop under latest version of Firefox for a few race weekends now. Right now opened the dashboard in Yandex Browser (chromium-based) during Monaco FP1 and my memory is doing absolutely fine. So I'm absolutely sure it's a Firefox bug that should be easily reproducable. Oh, also, the more my memory fills up, the higher the CPU usage is and the dashboard just freezes.

Running on Yandex Browser (Chromium-based)

Running on Firefox

slowlydev commented 1 month ago

Thanks for the issue, okay I will investigate this Firefox when I have time. If u want to you could run this in the browser console of the f1-dash tab and reload the page. And send me some screenshots when the lagging and so happens. localStorage.setItem("dev", "true") It enables a small UI which shows the buffers, because the buffers should be the biggest thing that consume memmory, but they should be capped at 1000 entries.

voidlynx commented 1 month ago

Yeah the total sum seems to be going over a thousand, but it starts lagging hard even before it gets near that number. EDIT: okay the sum also goes over a thousand on chromium but i simply lack the resources and time to see if i can get the State Engine Buffer (which does cap at a thousand in a normal environment) to that limit. it lags so hard not even a minute into firefox running.

image

slowlydev commented 1 month ago

Oh wow yeah, each buffer has a 1000 limit so we would be no where near the limits. Has this issue always been there or was it introduced lately?

voidlynx commented 1 month ago

I'm not sure since how long ago, but it did occur when watching the Imola GP. Probably a few weeks before that too. Likely way before that, can't say for sure.

slowlydev commented 1 month ago

Hm I did not seem to get the excessive leak you did. But I was also using firefox nightly and I am on arm macOS. I will test on a windows machine next.

image
simylein commented 4 days ago

Maybe this pr #119 could be part of the solution?