News for hackers. Stuff that matters.
Re:Improving Firefox stability with this one weird trick by hawski on Tuesday November 22, 2022 @10:08AM (#33706593)
For a few months now I saw a huge improvement on Linux regarding the memory management of Firefox. Previously I had to run Firefox in a separate cgroup to limit its memory usage, because it could easily deplete my whole RAM. And if I did close most of my tabs it did not release the memory back to the system. Now I never actually get to the limit I've set before and also with Auto Tab Discard extension it is well managed. So kudos to the team for such improvements.
Re:Improving Firefox stability with this one weird trick by Existenceblinks on Tuesday November 22, 2022 @10:30AM (#33706809)
Me too, on macOS, I notice memory is freed more.
Re:Improving Firefox stability with this one weird trick by chris_wot on Tuesday November 22, 2022 @05:23PM (#33712412)
I'm exclusively using Firefox on MacOS now.
Re:Improving Firefox stability with this one weird trick by marto1 on Tuesday November 22, 2022 @10:52AM (#33707053)
Correct me if I'm wrong, but the blog post is concerning a stability improvement on Windows specifically?
Re:Improving Firefox stability with this one weird trick by kaladin_1 on Tuesday November 22, 2022 @11:08AM (#33707272)
Yeah the article is about Windows. Even though you can see here: https://hacks.mozilla.org/author/gsveltomozilla-com/ that they also worked on MacOs and Linux stability this year.

I had abandoned Firefox entirely on MacOS until sometime I decided to try again and it was no longer attempting to claim an entire 32GB memory for itself. So, I am back as a happy user :)

Re:Improving Firefox stability with this one weird trick by hawski on Tuesday November 22, 2022 @04:26PM (#33711728)
It is, but it just reminded me of this other bit. Sorry if I was a bit too off topic. I just see those improvements on the sidelines and I'm glad.
Re:Improving Firefox stability with this one weird trick by gsvelto on Tuesday November 22, 2022 @12:29PM (#33708364)
I'm glad you noticed! We did indeed roll an improvement on Linux too, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1771712

In a nutshell we're directing the OOM killer towards less interesting processes within Firefox so that when the system is low on memory they'll get killed first. This not only makes it more stable overall but it plays nicer with other applications too. Web pages that leak memory in the background are particularly likely to be killed by this mechanism and that alone is a huge improvement in overall stability.

Re:Improving Firefox stability with this one weird trick by MayeulC on Tuesday November 22, 2022 @05:05PM (#33712200)
I was very excited about this improvement (it was covered on phoronix IIRC), but my systems still ends up thrashing when Firefox grows too big, unfortunately.

I usually keep an eye on the memory usage I have displayed in the taskbar, and have sysrq activated in case. I tried multiple things, including avoiding swapping to disk (only using zram), and Zen kernels. I'll have to see if I use MGLRU.

Re:Improving Firefox stability with this one weird trick by jml7c5 on Tuesday November 22, 2022 @06:17PM (#33712919)
Do you use a userspace OOM killer, like oomd or systemd-oomd?
Re:Improving Firefox stability with this one weird trick by MayeulC on Monday November 28, 2022 @05:37PM (#33780885)
I haven't set that up yet, though I've watched the recemt developments with interest. Another option would be to launch everything (or just Firefox) in cgroups.
Re:Improving Firefox stability with this one weird trick by heavyset_go on Tuesday November 22, 2022 @06:44PM (#33713167)
Does this OOM killer direction respect cgroup memory limits? Back when I was using Firefox on a low memory system, I ran it in a limited cgroup, but features like `browser.tabs.unloadOnLowMemory` wouldn't unload tabs on low cgroup memory, but only on low total system memory.
Re:Improving Firefox stability with this one weird trick by gsvelto on Wednesday November 23, 2022 @05:02AM (#33717216)
Yes it does, we've disabled tab unloading on Linux because low-memory detection just didn't work. We will re-enabled it sometimes down the line but only to avoid swap, not crashes. The OOM killer does already a good job with this change and we feel no need to do anything further (besides optimizing memory usage, but that's system-agnostic).
Re:Improving Firefox stability with this one weird trick by heavyset_go on Tuesday November 22, 2022 @06:41PM (#33713140)
> And if I did close most of my tabs it did not release the memory back to the system.

Check out `about:memory` and `about:unloads`, the former has memory minimization options and the latter lets you unload background tabs from memory.

Re:Improving Firefox stability with this one weird trick by Abishek_Muthian on Wednesday November 23, 2022 @12:53PM (#33722360)
> and also with Auto Tab Discard extension it is well managed

Have you compared it with the default Hibernation (Tab Unloading) recently? I don't use any extensions apart from UBlock Origin since I lost trust with extensions after seeing a recommended FF extension promoting scam.

When compared to Vivaldi's default hiberation(Where I have to manually trigger bg hibernation every now and then), FF's hibernation seems to do its thing (about:unload) quite well.