Last Comment Bug 808293 - Firefox should unload background tabs to save memory
: Firefox should unload background tabs to save memory
Status: RESOLVED DUPLICATE of bug 675539
[MemShrink]
:
Product: Firefox
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: unspecified
: Other Other
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
: Dão Gottwald [:dao]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-03 08:11 PDT by away[Nov24,Dec5) Kartikaya Gupta (email:kats@mozilla.com)
Modified: 2012-11-05 07:46 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description away[Nov24,Dec5) Kartikaya Gupta (email:kats@mozilla.com) 2012-11-03 08:11:50 PDT
As of bug 803575, Fennec will unload background tabs in low-mem situations to free up some memory. Switching back to an unloaded tab will re-load it. On the blog post describing this feature [1], somebody suggested doing this for desktop FF as well [2]. Sounds like a reasonable idea to me, although obviously the heuristics driving it should be different. Maybe let this idea simmer for a while until we see how the Fennec implementation does?

[1] https://staktrace.com/spout/entry.php?id=782
[2] https://staktrace.com/spout/entry.php?id=782#c1246
Comment 1 Justin Lebar (not reading bugmail) 2012-11-03 11:22:47 PDT
Bugzilla's search sucks, bug Google finds the dupe easily.

https://www.google.com/search?q=site%3Abugzilla.mozilla.org+unload+tabs

(Note that this is a minefield.  I'm surprised you guys were able to do it on Fennec without opposition!)

*** This bug has been marked as a duplicate of bug 675539 ***
Comment 2 Nicholas Nethercote [:njn] 2012-11-03 20:15:48 PDT
> (Note that this is a minefield.  I'm surprised you guys were able to do it
> on Fennec without opposition!)

Yeah, I'm also surprised by this.  Maybe there's less of an expectation on mobile that data will never be lost, because mobile browsing is somehow seen as more transient?
Comment 3 Justin Lebar (not reading bugmail) 2012-11-04 08:43:07 PST
Yeah, but I recall getting very strong pushback from mobile folks against the idea that Fennec should ever unload a tab (even a background tab) when going into the background.  

See e.g. bug 757918.

Anyway, hats off to you for getting this in.
Comment 4 Nicholas Nethercote [:njn] 2012-11-04 14:15:24 PST
> Anyway, hats off to you for getting this in.

Maybe people just didn't notice... we'll see if there are complaints during Aurora/Beta.
Comment 5 away[Nov24,Dec5) Kartikaya Gupta (email:kats@mozilla.com) 2012-11-05 07:46:02 PST
(In reply to Nicholas Nethercote [:njn] from comment #2)
> Maybe there's less of an expectation on
> mobile that data will never be lost, because mobile browsing is somehow seen
> as more transient?

I think this is true. In particular, Android will not hesitate to kill Fennec when Fennec is in the background and it needs more memory. So even if we don't do this, the "user contract" (stealing jlebar's term from [1]) has already been broken. Therefore breaking it a little bit more isn't as much of big deal.

(In reply to Justin Lebar [:jlebar] from comment #3)
> Yeah, but I recall getting very strong pushback from mobile folks against
> the idea that Fennec should ever unload a tab (even a background tab) when
> going into the background.  

Note that even with the new changes, we don't unload tabs when Fennec is put into the background. We will unload tabs if we get a memory pressure event, regardless of whether Fennec is in the foreground or background. I agree with :mfinkle in that we shouldn't just unload tabs when we go into the background, because there are valid use cases (e.g. the user is multitasking and switching rapidly between apps) where unloading tabs will be very visible and very bad UX.

Slightly off topic - I'm not sure if you watched the pancake post-mortem presentation last week, but it was interesting to note that one of the main reasons people leave so many tabs open is because there's no other way to deal with them that lines up with the mental model they have (they generally want to throw it into a temporary reading list or save it for later in some way). Solving that problem better might reduce the number of tabs people keep lying around, and make bug 675539 a moot point.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=757918#c5

Note You need to log in before you can comment on or make changes to this bug.