Investigate eagerly bfcaching background (discardable) apps

NEW
Unassigned

Status

()

P5
normal
6 years ago
3 months ago

People

(Reporter: cjones, Unassigned)

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(blocking-basecamp:-)

Details

In the common case, when app goes into the background, there's nothing useful it can do.  At best it will be idle, and at worst it will chew CPU/GPU/memory-bus without any perceived benefit to the user.

The not-common case is a background service, like something that polls email and notifies when a new one has arrived.  That provides perceived benefit to the user.

bfcache ensures (as best it can, there are bugs) that frozen pages don't waste machine cycles.  We should investigate doing this.

Per my discussion with jlebar, bfache also signals to apps that their memory usage becomes discardable.  There's no guarantee that we keep around bfcached pages.  This is very similar to what happens with foreground/background priority classes for the lowmemkiller; background-class apps can be killed whenever memory is tight.  Since the existing bfcache impl provides pagehide/pageshow notifications, this might be a good way to notify pages that they enter the "discardable" state (though they get discarded a lot "harder" with the lowmemkiller).

Note, this is complementary to the visibility notifications.

Comment 1

6 years ago
Do we have data on memory savings from pushing pages into bfcache? I'm also not clear on what percentage of pages is bfcache-friendly.
There is zero memory saving from moving a page into bfcache as compared to leaving the page active but un-bfcached.  Moving a page into bfcache merely "freezes" it, preventing the page from running scripts (for the most part).

We discussed this extensively in bug 793106.

Comment 3

6 years ago
(In reply to Justin Lebar [:jlebar] from comment #2)
> There is zero memory saving from moving a page into bfcache as compared to
> leaving the page active but un-bfcached.  Moving a page into bfcache merely
> "freezes" it, preventing the page from running scripts (for the most part).
> 
> We discussed this extensively in bug 793106.

I see bfcache was just thrown to confuse things. So this really means implementing something like https://addons.mozilla.org/en-US/firefox/addon/suspend-background-tabs/
No.  You're throwing random things into this bug and confusing things.

As jlebar said in comment 2, there was extensive discussion of policies on discarding memory in bug 793106, which is kind of confusing because the title also includes the word "bfcache".  The discussion there grew beyond the original bug scope.  Would recommend heading there!

Comment 5

6 years ago
not blocking for v.1
blocking-basecamp: --- → -
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.