[Native Fennec] Expire unused tabs

RESOLVED FIXED in Firefox 19

Status

()

Firefox for Android
General
RESOLVED FIXED
5 years ago
a year ago

People

(Reporter: kats, Assigned: kats)

Tracking

unspecified
Firefox 19
All
Android
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

In the case where the user has many tabs opened, but has not used some of the tabs in a while, we should kill the tab and free the memory it is holding. Serializing the entire page is very tricky to do, but we should be able to kill the tab and use the session-restore code to bring it back if the user switches back to it.
We could use this for armv7 too. I think this is a memory requirement, not CPU requirement.
Assignee: nobody → bugmail.mozilla
Created attachment 670885 [details] [diff] [review]
Part (1/2) - Add an TabMruList object to maintain an MRU list of tabs
Attachment #670885 - Flags: review?(mark.finkle)
Created attachment 670888 [details] [diff] [review]
(2/2) Zombify an appropriate tab on opening a new one

I figured opening a new tab would be a good place to zombify an older tab because that's where we know we're going to need a bunch of memory. We could move this call elsewhere though. Also note that even with this code the zombieTime pref is still set to -1 so zombification will be off by default.
Attachment #670888 - Flags: review?(mark.finkle)
Comment on attachment 670885 [details] [diff] [review]
Part (1/2) - Add an TabMruList object to maintain an MRU list of tabs

I like the concept here. Every time I start to review the code, I want to change the structure though. A few things:
1. Make "TabMruList" become "Tabs", which manages the tabs. We'd extract a lot of code from BrowserApp.
2. Couldn't we just use Tab.lastTouch (as a Date) and just compare that when zombifying?

#1 could wait for a refactor. What about #2? Do we need the mruIndex too?
Comment on attachment 670885 [details] [diff] [review]
Part (1/2) - Add an TabMruList object to maintain an MRU list of tabs

Yeah I was also thinking about how the mruIndex is pretty much useless since we can accomplish the same thing using just the timestamp. I'll redo these patches, I think I can make it much less bloated.
Attachment #670885 - Flags: review?(mark.finkle) → review-
Attachment #670888 - Flags: review?(mark.finkle) → review-

Updated

5 years ago
Whiteboard: [ARMv6]
Created attachment 673257 [details] [diff] [review]
(1/2) Maintain most recent use timestamps on tabs

Updated as per comments
Attachment #670885 - Attachment is obsolete: true
Attachment #673257 - Flags: review?(mark.finkle)
Created attachment 673258 [details] [diff] [review]
(2/2) Zombify an appropriate tab on opening a new one

Rebased. Note that this still doesn't enable it by default since the zombieTime pref is -1
Attachment #670888 - Attachment is obsolete: true
Attachment #673258 - Flags: review?(mark.finkle)
Comment on attachment 673257 [details] [diff] [review]
(1/2) Maintain most recent use timestamps on tabs

Nice
Attachment #673257 - Flags: review?(mark.finkle) → review+
Attachment #673258 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c0a5d9f82ee
https://hg.mozilla.org/integration/mozilla-inbound/rev/9086b50a71c3
Blocks: 803575
https://hg.mozilla.org/mozilla-central/rev/4c0a5d9f82ee
https://hg.mozilla.org/mozilla-central/rev/9086b50a71c3
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Is there no chance that user data (e.g. partially filled-in forms) will be lost?  After all the previous discussion I've seen on this kind of thing, I'm surprised that two small patches is enough to make it work safely.  How does this differ from bug 675539?
(In reply to Nicholas Nethercote [:njn] from comment #11)
> Is there no chance that user data (e.g. partially filled-in forms) will be
> lost?  After all the previous discussion I've seen on this kind of thing,
> I'm surprised that two small patches is enough to make it work safely.  How
> does this differ from bug 675539?

Currently, Firefox Mobile session restore does not save off form data. Therefore, expired tabs would lose any partial form data the user filled.

We could add that feature, or a minimal version of it.

This bug is similar to bug 675539, but that patch is limited to desktop Firefox.

Updated

5 years ago
Summary: [ARMv6] Expire unused tabs → [Native Fennec] Expire unused tabs
Whiteboard: [ARMv6]

Updated

5 years ago
Blocks: 816381
You need to log in before you can comment on or make changes to this bug.