Firefox lag

I have noticed a recent behaviour with Firefox. The firefox window and web content will hang or freeze momentarily. The mouse cursor will move over the window but not change when over a link. Arrow or page up/down keys are cached. After a few seconds, the web page acts normally - links are clickable, any key strokes that were get executed. Not sure what the cause is but it is recent.

This is on a fedora 40 workstation, nvidia card with rpmfusion-based driver. All rpms current.

This mildly annoying only.

best regards

2 Likes

As an update, it seems that this hang/lag happens when I click on an existing tab or open a link in a new tab. Content of the tab is basically frozen for the first 10 seconds or so. Very unusual and fairly recent occurrence.

2 Likes

Hello @buckaroogeek,

I have got the same problem on my fedora 47 installation. Have you found any solution so far or could provide more information?

Best regards
Justin

Greetings

No solution yet.

I filed a bug at: 2315475 – Firefox UI episodically hangs for short periods.

Martin Stransky reached out and asked me to also file a bug with Mozilla which is: 1921999 - Firefox UI episodically hangs for short periods with Fedora.

Martin thought it might be related to: https://bugzilla.mozilla.org/show_bug.cgi?id=1890074. There has been a fair amount of activity on this thread but so far nothing conclusive.

1 Like

I watched a video made a few months ago where the YouTuber suggested this might be a Nvidia error. If you have an APU try enabling that for a bit and see if this fixed the problem. I also believe he used Wayland at the time, if your GNOME is on Wayland try switching back to Xorg.

1 Like

It may be totally unrelated but I got a similar issue with the hardware decoding of VP9 videos, “vainfo” and Firefox information said it was supported but the video stopped after some seconds, Firefox spit several errors and then the video started again with software decoding. Two options, one was to remove the (Intel) driver needed to hardware decoding and the other was to disable VP9 via “about:config” setting. I saw the problem only by starting Firefox from the terminal.

Besides video decoding, I am having some sort of mem leak with Youtube. In short, Firefox adds more RAM as I move from a video to the next and it does not release it, so the more videos, the more RAM is used.

Chromium uses way less RAM in the same conditions.

Ok, thank you for the information. It’s very unpleasing to hear that there is no solution yet nor any direction being taken because this problem is turning the user experience much worse.

Is there anything I can do in order to push those bug reports? Should I maybe answer and say that I have the same problem for them to have more information to analyze?

I already tested this. For me the error occurs on my Nvidia GTX 1080 as well as on my integrated Intel i5 8600k APU.

One Workaround I found in the meanwhile is using Xorg instead of Wayland.

@lendenu how can I check if this is happening for me as well? I suspect that it could have something to do with video playback, because the freezes seem to occur more frequently when playing videos but as described in Brad Smith’s Bug report, they also occur when just opening a tab, scrolling or switching to the Firefox windows from another one.

Nvidia doesn’t support VAAPI, using libva-nvidia-driver is a hack, if it’s causing issues remove it.

To get the most obvious errors from Firefox you open a terminal and type “firefox” - enter. It opens Firefox and gives you the output in the terminal window.

You can also type “firefox -p” and the profile manager opens. Then you can create a “testing” profile, open Firefox with this profile and test a different configuration, like no extensions or enabling or disabling features through “about:config” without changing your regular profile.

You can easily disable VP9 or AV1 hardware decoding, you can disable any video hardware decoding alltogheter, you can also disable hardware acceleration for Web pages (it means Firefox relies only on the CPU via software).

When opening firefox via the terminal I get no errors when the freezes occur.

@leigh123linux I only installed thenvidia-vaapi-driver as an attempted solution and after removing it nothing changed.

Are you sure it is only Firefox that freezes?
I mean, if the freezes are system-related, they should involve any running software.
Like a media player. Do you see any issue while playing a video locally? (not from the Internet but as a file).
Edit:
I recalled I had another similar issue with the WiFi, basically Firefox (or any other software that required the connection) froze when there were no data coming from the net and that was the WiFi that kept coming and going. It is something like the “buffering” with videos, you know the spinning wheel.

In my experience it’s only related to Firefox and only happening under Wayland. Even Chromium works flawlessly so I suspect it has nothing to do with my WiFi. Or it could be related to how Firefox handles such WiFi issues but I suspect that this isn’t the case, because it hasn’t always been this way and I’m still in the same network and building.

To echo @justinthesnacc, I am only seeing this occur with firefox. One of the first things Martin asked me to try was launching firefox from the terminal and also trying a new profile. I have the same experience reported above - no error messages in the terminal (and none in the journal), and the lag still present in firefox with a new profile.

best regards

1 Like

I have Chromium but it DOES NOT run on Wayland, regardless how I set the “chrome:flags”, it defaults on XWayland.
I would say that IF the freezing happens only with Wayland, you could use Firefox with XWayland, forcing it with the proper parameter.

I am sorry to write this but Chromium works better than Firefox but I am not sure if that is always the case or it depends on Web sites being developed and tested with Chrome only.