Closed Bug 1625326 Opened 1 year ago Closed 11 months ago

Figure out prioritization levels for non-content processes


(GeckoView :: General, task, P1)



(firefox78 fixed)

Tracking Status
firefox78 --- fixed


(Reporter: aklotz, Assigned: aklotz)


(Blocks 1 open bug)


(Whiteboard: [geckoview:m78])


(1 file)

Per discussion at

if we go to the background we probably care more about the main process staying alive that the media process or the socket process (when it will be enabled).

ie we need to determine how/what to do with those processes priorities.

Whiteboard: [geckoview:m77]
Assignee: nobody → aklotz
Priority: -- → P1
Whiteboard: [geckoview:m77] → [geckoview:m78]

I think that the status-quo of non-content processes always receiving foreground is fine. When the parent goes background, Android sends its bound child processes to the background along with it.

Maybe the only exception to that would be if we wanted to be clever with respect to the extension process. As a hypothetical example, suppose the user has installed an extension that is restricted to specific origins. Perhaps we don't boost the extension process's priority to foreground unless there are content process(es) corresponding to those origins are in the foreground.

I think I'm going to resolve this as WORKSFORME for now.

Closed: 1 year ago
Resolution: --- → WORKSFORME

Ah, or maybe we want to do something about relative priority so that, as mentioned in the description, other processes are terminated before the main process is.

Resolution: WORKSFORME → ---

Gecko's process priority manager works exclusively with content processes, so that is not particularly useful here.

Probably the best way for us to handle this is 100% at the Java layer, using the proper lifecycle callbacks to adjust the non-content process priority.


Hmm, maybe we can also alter the socket process's priority depending on the state of network connectivity.

  • We attach a native counterpart to ths GeckoProcessManager.ConnectionManager
    instance that listens for app foreground, app background, and when the
    socket process is enabled, network state events.
  • On app background, all non-content processes are assigned BACKGROUND priority.
    Even though backgrounding the app will cause Android to drop all child
    processes' priority regardless of our priority settings, we still do this as
    to indicate to Android that these processes are relatively less important
    than our parent process.
  • When the socket process is enabled, we drop its priority when we detect that
    we have no network connectivity. Note that the network management code does
    the Right Thing if network connectivity changes while our app was in the
    background: we receive the network state change event once we return to
    foreground, therefore we do not need to do any special handling ourselves.
Attachment #9146912 - Attachment description: Bug 1625326: Add priority managment for non-content child processes to GeckoProcessManager; r=#geckoview-reviewers → Bug 1625326: Add priority management for non-content child processes to GeckoProcessManager; r=#geckoview-reviewers
Blocks: 1636720
See Also: → 1639356
Pushed by
Add priority management for non-content child processes to GeckoProcessManager; r=geckoview-reviewers,agi
Closed: 1 year ago11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.