Open Bug 1905246 Opened 3 months ago Updated 16 days ago

Firefox uses 35-70% more memory than Chrome when put in background after playing a video

Categories

(Core :: Audio/Video, defect)

Firefox 127
All
Android
defect

Tracking

()

People

(Reporter: jlink, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Steps to reproduce

  1. Close all tabs and force stop the app.
  2. Open a new tab to play a video in Youtube. (I used https://m.youtube.com/watch?v=-ZeAr9ROO8w for my tests.)
  3. After 30 seconds, press the "home" button and turn off the screen.
  4. Check the memory usage again at various points via adb using "adb shell dumpsys meminfo".

Expected behavior

Total memory usage by Firefox processes would be lower and closer to total memory usage by Chrome processes.

Actual behavior

Firefox (org.mozilla.firefox package) uses 6 total processes when playing video: the main process, the gpu process, two "tab" processes (one of which is the content process and the other of which is the extension process), a utility process and a media process. I ran this test twice for Firefox and got pretty consistent results. Here are the averages across those runs, per-process:

RSS:
  362,288K: org.mozilla.firefox (pid 20003 / activities)
  268,488K: org.mozilla.firefox:tab34 [content process]
  227,292K: org.mozilla.firefox:gpu
  171,296K: org.mozilla.firefox:tab15 [extension process]
  129,848K: org.mozilla.firefox:utility
  118,104K: org.mozilla.firefox:media
----------
1,277,316K

PSS:
  175,526K: org.mozilla.firefox
  122,289K: org.mozilla.firefox:tab34 [content process]
   94,418K: org.mozilla.firefox:gpu
   38,464K: org.mozilla.firefox:tab15 [extension process]
   18,605K: org.mozilla.firefox:utility
   12,399K: org.mozilla.firefox:media
----------
  461,701K

Chrome (com.android.chrome) uses 3 total processes when playing this same video: the main process, a gpu process and a content process. I ran this test three times for Chrome and got pretty consistent results as well. Here are the averages across those runs, per-process:

RSS:
  315,715K: com.android.chrome
  216,016K: com.android.chrome:privileged_process0
  218,372K: com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:1
  --------
  750,101K

PSS:
  152,613K: com.android.chrome (pid 20018 / activities)
   82,015K: com.android.chrome:privileged_process0 (pid 20104)
  106,553K: com.android.chrome:sandboxed_process0:org.chromium.content.app.SandboxedProcessService0:1 (pid 20189)
  --------
  341,181K

According to these numbers, Firefox is using about 70% more memory according to RSS accounting and 35% more memory according to PSS accounting when in the background after playing this video.

Device information

  • Firefox version: 127.0.1
  • Android device model: Pixel 6
  • Android OS version: 14

Any additional information?

I'm not sure how important is was but, prior to running tests in a given browser, I closed all tabs in that browser, cleared the cache for that browser and restarted my device.

Component: Performance → Audio/Video
Product: Fenix → Core
Version: unspecified → Firefox 127
Blocks: 1894804

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)

The meta is useful, thanks. We'll try to find some cycles to go through them.

Severity: -- → S3
Flags: needinfo?(jmathies)
You need to log in before you can comment on or make changes to this bug.