I’ve been having an issue with the native Firefox on two installs for a few months now since updates - one laptop with Ultramarine 43 KDE and one PC with Fedora 43 KDE - So I don’t think it’s a distribution problem.
The issue is Firefox will be behaving normally (using just under 3GB with current open tabs). Normally the system RAM will be sitting under 50%. Then for no reason after a time - freeze and become unresponsive while the memory usage slowly ramps up to 90-95% (around 10-12GB on a 16GB). If I’m quick enough, sometimes I can kill Firefox myself before it makes the whole system unresponsive. If the system runs out of memory, KDE might kill Firefox itself after about 5-10min. Depending on how much memory is used, sometimes Firefox will recover itself after a few minutes and start working again. But it will keep happening until Firefox is restarted again.
It seems to happen more when the PC is left idle for a bit and you come back to it (so it could be the screen saver has been activated and the monitor would have turned off). I suspect the system might be pushing tabs to SWAP space (or reading from it)
Restarting Firefox seems to temporarily fix the issue for a time, but invariably comes back again. I’ve tried disabling all of the plugins I’m using (which doesn’t seem to make a difference either).
I’ve seen Bug reports for this very issue, but apparently it was fixed in previous updates?
Other than trying to uninstall and reinstalling Firefox, anything else I should be trying? Or is this just a bug that should be reported?
There are reports that the systemd-ooom.service is not enabled on some f43 systems.
Make sure that the systemd-oom service is enabled and running then it should kill firefox for you.
systemctl status systemd-ooom.service
If it not enabled and running:
sudo systemctl enable --now systemd-ooom.service
When the problem happens it will be worthy checking in the user and system journals for errors that may give a clue to the issue.
Usually when a web browsers memory use grows it’s triggered by the web sites you are visiting. Keep track of the sites you visit and see if the problem correlates with a particular site or set of sites.
Will this be persistent after a reboot? Or would I need to add it somewhere?
This might stop the whole OS crashing, but not really why Firefox is doing it in the first place.
I’d sort of thought about that, but the two PCs have different tabs open and the problem only seemed to start happening after an update a few months back.
I’ll have a look at the logs next time it’s happening. As I said, seems to do it for no apparent reason as it’s currently behaving at present.
Will do. I had a quick try and yep, brings up all of the current processes for the tabs which will be handy. Maybe there’s a certain tab that’s not being loaded after the restart and only starts after a certain amount of time?
The problem disappeared again for a while but has now come back again. I opened both KDE System Monitor, HTOP and the Firefox process tab with “shift=esc”.
Unfortunately I couldn’t really narrow it down to one misbehaving tab or process. But its definitely one of the Firefox processes and possibly a Youtube tab. And the processes that System Monitor and HTOP showed where two different PIDs.
There’s a lot of other tabs and windows open - 10 Windows (with multiple tabs in each. One Window has 9 Youtube tabs. 4 actively loaded, 5 weren’t open and inactive (from the last restart of Firefox). These were using the most memory.
What I observed with the system monitors was
current active tab (with Youtube) sat around 400-500mb
Total memory used by firefox was sitting around 1000mb
Total system memory usage was about 50% (8GB).
Whenever there was a CPU spike (about 15-20%), the memory would also climb to 70-80% for a short time with video playback also stuttering for a second. Then return back to 50% memory.
I watched 3 of the videos on the active (open) tabs for an hour and the memory CPU continued to spike maybe every 10sec. I closed the tab when I was finished watching. When I got to the 4th active YT tab and started watching that, I switched to a completely different window and did some other work (while watching YT in the background). The problem mysteriously went away again. And still stayed away when I went back to that Window.
Currently
Firefox is sitting at 850mb total
current tab using 450mb
system is at 6.5gb with no spikes from the YT tabs
It’s possible that closing one those tabs was the issue. But it was still doing it when I started to play the video in the 4th (last active) tab. I haven’t had the issue on the other computer since restarting, bookmarking all of the open tabs and closing them.