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).
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.