Live data from Hacker News

Tab Unloading in Firefox 93

hacks.mozilla.org

11–20 of 283 posts

Re: Tab Unloading in Firefox 93

#11
post #4

> "On Windows, out-of-memory (OOM) situations are responsible for a significant number of the browser and content process crashes reported by our users." You got this wrong, yet again. What causes the memory to run out in the first place? That is what you should be fixing.

> What causes the memory to run out in the first place? That is what you should be fixing.

Either the user opened enough tabs to use memory, or the rest of the system is using too much memory. Neither of those is "fixable"; a browser that randomly closes your tabs or kills other programs is not going to be well received.

Re: Tab Unloading in Firefox 93

#12
> On Windows, Firefox gets a notification from the operating system (setup using CreateMemoryResourceNotification) indicating that the available physical memory is running low.

I've longed for such a mechanism in Linux, but I don't think it exists. This should at least be an OS-level signal IMO, though a D-Bus interface could also work. Integrating with one of the recent userspace OOM daemons could be a good idea.

Re: Tab Unloading in Firefox 93

#13
I've never had Firefox crash. I guess they are reaching for those edge cases on power users who keep a billion tabs open. Maybe I'm missing some sort of productivity hack that involves leaving 100+ tabs open.

Re: Tab Unloading in Firefox 93

#14
post #3

I left Firefox for a number of years already. Did Firefox changed its Tab Unloading behaviour? I remember Firefox will unload Tabs that are inactive after a period of time. So having OOM crash on Firefox was a relatively rare occurrence even when I had hundreds if not thousands of tabs.

If you had restore tabs on restart then tabs that were in the background and not pinned would not be loaded until focused. Tabs would not be unloaded unless you restart the browser. The first implementations were in the Fx 20 range and some additional improvements in the 55 timeframe. The feature in 93 is suspending without the need to restart the browser.

https://www.google.com/search?client=firefox-b-1-d&q=site%3A...

Re: Tab Unloading in Firefox 93

#15
post #4

> "On Windows, out-of-memory (OOM) situations are responsible for a significant number of the browser and content process crashes reported by our users." You got this wrong, yet again. What causes the memory to run out in the first place? That is what you should be fixing.

Why do computers keep getting more and more memory? 640KB should be enough for everyone, if people would just fix whatever is using up all the memory. /s Not all OOM situations are because of a malfunction or leak.

Let's say you want to have a wallpaper on your 1920x1080 desktop. At 24bpp, that's ~6MB right there.

Re: Tab Unloading in Firefox 93

#16
I've been experimenting and exploring a few ways to implement this for my own browser [1].

The options seem to be:

- Great Suspender style suspension [2] - swap page with a simple low memory placeholder and reload back (detecting interactions)

- Chrome/FF style tab discarding (only happens with memory pressure) [this post and 3]

- Optimistic unloading with screenshots (this is what we're experimenting with) - we suspend the tab and replace it with a screenshot of the tab before it was suspended, you trigger a reload if you need it. It seems that the screenshot gives you access to the information you cared about while being easy to unload and reload from memory and making it much less likely you actually trigger a reload.

One final one I've been thinking about that I haven't gotten around to testing yet for fast-fan-syndrome (and non-memory limited systems) is to just use renice/cputhrottle (in macOS for example) to force CPU share limits on the processes. This has portability issues and requires certain privileges which is why I'm hesitant to try it immediately.

These obviously have their issues like stopping the JS VM when there might be long running thing that was actually desired (usually prevented with a whitelist).

Happy to test any other ways you think might work!

[1] https://synth.app [2] https://chrome.google.com/webstore/detail/the-great-suspende... [3] https://developers.google.com/web/updates/2015/09/tab-discar...

Re: Tab Unloading in Firefox 93

#17
Something surprising I learned recently is that this is an anti-pattern when building an iOS app. iOS has a memory compressor, so if you try to purge resources in a low-memory situation, it can cause memory use to spike as the things you're trying to free get decompressed.

The SDK provides a notification when memory pressure is high, so people try to get aggressive and purge their caches and unused assets when that notification arrives, but that only makes the problem worse.

Re: Tab Unloading in Firefox 93

#18
post #13

I've never had Firefox crash. I guess they are reaching for those edge cases on power users who keep a billion tabs open. Maybe I'm missing some sort of productivity hack that involves leaving 100+ tabs open.

Firefox runs on systems with 512MB RAM. [1] Can you imagine keeping a Slack tab open on a system like that? Never mind 100 tabs.

[1] https://www.mozilla.org/en-US/firefox/93.0/system-requiremen...

Re: Tab Unloading in Firefox 93

#19
post #13

I've never had Firefox crash. I guess they are reaching for those edge cases on power users who keep a billion tabs open. Maybe I'm missing some sort of productivity hack that involves leaving 100+ tabs open.

It's the same productivity hack as the piles of stuff around my house I'm never going to use.

Re: Tab Unloading in Firefox 93

#20
post #4

> "On Windows, out-of-memory (OOM) situations are responsible for a significant number of the browser and content process crashes reported by our users." You got this wrong, yet again. What causes the memory to run out in the first place? That is what you should be fixing.

> What causes the memory to run out in the first place? That is what you should be fixing. Either the user opened enough tabs to use memory, or the rest of the system is using too much memory. Neither of those is "fixable"; a browser that randomly closes your tabs or kills other programs is not going to be well received.

Or one tab starts leaking memory like crazy after some time (looking at you Jenkins).
Post reply on HN