Closed Bug 1587762 Opened 2 years ago Closed 1 month ago

Re-enable automatic tab unloading when running out of memory

Categories

(Firefox :: Tabbed Browser, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
93 Branch
Fission Milestone MVP
Tracking Status
relnote-firefox --- ?
firefox-esr78 --- wontfix
firefox-esr91 --- wontfix
firefox91 --- wontfix
firefox92 --- wontfix
firefox93 --- fixed

People

(Reporter: gsvelto, Assigned: toshi)

References

(Depends on 7 open bugs, Blocks 3 open bugs)

Details

(Whiteboard: fission-soft-blocker)

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #675539 +++

In bug 1558930 we disabled tab-unloading-when-low-on-memory because of the various issue we ran into both with faulty low-memory detection and with tabs with active WebRTC sessions being unloaded.

I'm filing this to track the work needed to re-enable the feature.

No longer depends on: tab-unloading
Depends on: 1532955
Depends on: 1475889
Depends on: 1579198
Depends on: 1586236
See Also: → 1553260
Priority: -- → P3
See Also: → 1450371
Fission Milestone: --- → MVP
Depends on: 1682442
Fission Milestone: MVP → M8
Depends on: 1701368
No longer depends on: 1579198

We will try enabling this again if the Telemetry from the field show the memory pressure info is reliable and we fix bug 1701368. Gsvelto to coordinate.

Assignee: nobody → gsvelto
Severity: normal → S4
Priority: P3 → P2
Depends on: 1715858

Tab unloading is a nice-to-have for our Fission Release experiment, but doesn't need to block it. I will move this bug from Fission Milestone M8 to MVP.

Fission Milestone: M8 → MVP

Handing this over to Toshihito who's been doing all the work

Assignee: gsvelto → tkikuchi
Status: NEW → ASSIGNED
Depends on: 1720503
Depends on: 1721700

This bug is a soft blocker for Fission MVP. We'd like to fix it before our Release channel rollout, but we won't delay the rollout waiting for it.

Whiteboard: fission-soft-blocker

Is there also something like Chrome's chrome://discards to force tabs to be unloaded, to see why a tab was discarded and to see what's next to be discarded? :)

(In reply to Poopooracoocoo from comment #6)

Is there also something like Chrome's chrome://discards to force tabs to be unloaded, to see why a tab was discarded and to see what's next to be discarded? :)

Thank you for pointing out chrome://discards! I didn't know that page and personally loved it, especially the Graph visualization. Currently we don't have any similar UI. I'll file a bug to consider it in the future.

See Also: → 1725257
Pushed by tkikuchi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0da4ca660b53
Enable browser.tabs.unloadOnLowMemory by default.  r=haik
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Setting status-firefox92=wontfix because we don't need to uplift tab unloading to Beta.

Depends on: 1726656

Chris, is that something worth mentioning in our 93 nightly/beta release notes? Thanks

Flags: needinfo?(cpeterson)

(In reply to Pascal Chevrel:pascalc from comment #11)

Chris, is that something worth mentioning in our 93 nightly/beta release notes? Thanks

Yes. That's a good idea!

@ Toshi, please review my proposed note below about tab unloading for Firefox 93's release notes. Feel free to suggest a better description.

Release Note Request (optional, but appreciated)

[Why is this notable]: Tab unloading is expected to reduce Firefox memory usage and out-of-memory crashes. Tab unloading is only enabled on Windows in 93. Support for macOS (bug 1595627) and Linux (bug 1532955) is in progress for a later release.

[Suggested wording]: Firefox on Windows will unload some tabs when available system memory is low. This should help reduce Firefox out-of-memory crashes. Switching to an unloaded tab will automatically reload it.

[Links (documentation, blog post, etc)]: No documentation that I know of besides this bug.

relnote-firefox: --- → ?
Flags: needinfo?(cpeterson) → needinfo?(tkikuchi)

@ Toshi, please review my proposed note below about tab unloading for Firefox 93's release notes. Feel free to suggest a better description.

Thank you for filling the template. They all look great. It might be more helpful to add information about which tab will be unloaded like this:

[Suggested wording]: When available system memory is low, Firefox on Windows will automatically unload some tabs based on their last access time, memory usage, and other attributes. This should help reduce Firefox out-of-memory crashes. Switching to an unloaded tab reloads it.

Flags: needinfo?(tkikuchi)

(In reply to Toshihito Kikuchi [:toshi] from comment #13)

@ Toshi, please review my proposed note below about tab unloading for Firefox 93's release notes. Feel free to suggest a better description.

Thank you for filling the template. They all look great. It might be more helpful to add information about which tab will be unloaded like this:

[Suggested wording]: When available system memory is low, Firefox on Windows will automatically unload some tabs based on their last access time, memory usage, and other attributes. This should help reduce Firefox out-of-memory crashes. Switching to an unloaded tab reloads it.

Note added to our 93 nightly release notes, thanks!

Now that this is on the way I hope next we could look into bug 1665885 which would prioritize unloading [hidden] ads on memory pressure events - a better first stop before unloading tabs.

Not sure if this was mentioned, but I had an extension/addon called "dormancy". Not sure if this is the same thing or not, but figured it might help. I'm hoping this new functionality will replace "dormancy" entirely. Let me know if this is related or the same as what you are working on. Thanks.

https://github.com/autonome/Dormancy

Not sure if this was mentioned, but I had an extension/addon called "dormancy". Not sure if this is the same thing or not, but figured it might help. I'm hoping this new functionality will replace "dormancy" entirely. Let me know if this is related or the same as what you are working on.

There's a number of these add-ons, either automatic (based on time), or manual. The main difference is that the new functionality has a more global view of all Firefox tabs and the system memory state (this part was added recently) so it can make the decision which tabs to unload automatically. The main goal of the built-in feature is to reduce the number of cases where Firefox would crash because the system runs out of memory. Now, if we detect that this is going to happen, we try to prevent (or delay) that by unloading inactive tabs.

From the description of the add-on, it's not 100% the same goal: the add-on minimizes Firefox memory usage. The built-in feature would keep Firefox using that memory (To keep it fast: reloading tabs is slow!) until we detect that this would cause system stability issues.

I expect this will be mostly useful on 4GB/8GB machines, or maybe beefier ones if you're running really memory intensive workloads.

(In reply to Gian-Carlo Pascutto [:gcp] from comment #17)

(To keep it fast: reloading tabs is slow!)

And also potentially loses some state on more complex pages.

(In reply to Gian-Carlo Pascutto [:gcp] from comment #17)

... not 100% the same goal: the add-on minimizes Firefox memory usage. The built-in feature would keep Firefox using that memory (To keep it fast: reloading tabs is slow!) until we detect that this would cause system stability issues.

I expect this will be mostly useful on 4GB/8GB machines, or maybe beefier ones if you're running really memory intensive workloads.

When you say "this will be mostly useful on 4GB/8GB machines", do you mean the extension/addon, or this bug?

When you say "this will be mostly useful on 4GB/8GB machines", do you mean the extension/addon, or this bug?

The built-in feature to prevent crashes. Those kind of machines are the ones where we see out-of-memory crashes the most (if it happens on larger machines it's often due to user misconfiguration like disabling page files etc).

Depends on: 1729911
Depends on: 1729918
Depends on: 1730066
Depends on: 1730209
You need to log in before you can comment on or make changes to this bug.