Closed Bug 1447393 Opened 7 years ago Closed 7 years ago

Keep content process alive even if there are no "tabs"

Categories

(GeckoView Graveyard :: Sandboxing, enhancement, P1)

enhancement

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: snorp, Assigned: snorp)

References

Details

Attachments

(1 file)

Normally, ContentParent will shut down a content process once it is empty. This causes problems with GeckoView because: 1) GeckoView currently supports only one content process, due to the way they are hosted in the Service. We could expand this, but I also think we want to limit it to 1 for memory usage concerns. 2) When a process is abandoned in ContentParent, it is apparently not done synchronously. Consequently, when a new tab is created, we could be waiting for the old process to die when a new one is requested. This fails due to 1). It's also possible that process shut down is completely broken on Android right now, because it's not clear to me how it should be working. It's possible to set dom.ipc.keepProcessesAlive.web to keep a content process alive even when it is empty. I think we should set that for now to avoid the above problem, pending a more robust solution.
Priority: -- → P1
Assignee: nobody → snorp
Comment on attachment 8960704 [details] Bug 1447393 - Keep empty content process alive on Android https://reviewboard.mozilla.org/r/229460/#review235256 Seems reasonable to me.
Attachment #8960704 - Flags: review?(mrbkap) → review+
Comment on attachment 8960704 [details] Bug 1447393 - Keep empty content process alive on Android https://reviewboard.mozilla.org/r/229460/#review235602 r- on the first issue raised here, easy to patch up. So looking through here I see this comment which really needs to be removed if we're going to use this setting in production - https://searchfox.org/mozilla-central/source/dom/ipc/ContentParent.cpp#1856 Also, I think you should turn off the preallocated process manager here for completelness. This code makes its decision to recycle here - https://searchfox.org/mozilla-central/source/dom/ipc/ContentParent.cpp#1815 The pref is 'dom.ipc.processPrelaunch.enabled' code is here if you're curious - https://searchfox.org/mozilla-central/source/dom/ipc/PreallocatedProcessManager.cpp Lastly, are you sure you want to do this? :) Child processes can accumulate a lot of cruft over time. It's a known issue and one of the reasons we recycle content processes on a regular basis.
Attachment #8960704 - Flags: review?(jmathies) → review-
Comment on attachment 8960704 [details] Bug 1447393 - Keep empty content process alive on Android https://reviewboard.mozilla.org/r/229460/#review235602 Yeah, we do eventually want to have more content processes. For now we just want to try to make things stable. Generally on Android, though, the app will die often enough that we won't have the same problems with a long-running content process. I think this should be especially true with Focus, the first GeckoView-using app.
Attachment #8960704 - Flags: review?(jmathies) → review+
Pushed by jwillcox@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4c6aa2c88102 Keep empty content process alive on Android r=jimm,mrbkap
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 61
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 61 → mozilla61

Moving content process management bugs to the new GeckoView::Sandboxing component.

Component: General → Sandboxing
Product: GeckoView → GeckoView Graveyard
See Also: → 1937836
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: