<will add description>
Bug 1753700 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
During our investigation for Bug 1752632, we noticed that Fenix does not prioritize the current tab appropriately when the screen is off or the browser is in the background. In our testing, when in foreground, both the main process and the current tab process receive an `oom_adj` of `0` which is correct. When the app is in the background, however, the main process receives an `oom_adj` score of `11`, while the main tab has a score of `16`. Worse yet, when the screen is off the main process has a score of `0` but the tab process has a score of `16`. We should prioritize the current tab process at the same level as the main process. From our investigation, this is due to the fact that when we lose the surface associate to the current tab, we don't know what the current tab is anymore, so [we can't prioritize it accordingly](https://searchfox.org/mozilla-central/rev/bb14d901ac16633801b7f4adaa4fb104e6f072e4/dom/ipc/ProcessPriorityManager.cpp#744-755). We could use the extension's [activeTab](https://searchfox.org/mozilla-central/rev/bb14d901ac16633801b7f4adaa4fb104e6f072e4/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java#1056) as a hint that the tab is still the current one and prioritize the process accordingly.
During our investigation for Bug 1752632, we noticed that Fenix does not prioritize the current tab appropriately when the screen is off or the browser is in the background. In our testing, when in foreground, both the main process and the current tab process receive an `oom_adj` of `0`, which is correct. When the app is in the background, however, the main process receives an `oom_adj` score of `11`, while the main tab has a score of `16`. Worse yet, when the screen is off the main process has a score of `0` but the tab process has a score of `16`. We should prioritize the current tab process at the same level as the main process. From our investigation, this is due to the fact that when we lose the surface associate to the current tab, we don't know what the current tab is anymore, so [we can't prioritize it accordingly](https://searchfox.org/mozilla-central/rev/bb14d901ac16633801b7f4adaa4fb104e6f072e4/dom/ipc/ProcessPriorityManager.cpp#744-755). We could use the extension's [activeTab](https://searchfox.org/mozilla-central/rev/bb14d901ac16633801b7f4adaa4fb104e6f072e4/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/WebExtensionController.java#1056) as a hint that the tab is still the current one and prioritize the process accordingly.