Closed Bug 1678403 Opened 4 years ago Closed 2 years ago

Huge memory usage from youtube

Categories

(Core :: JavaScript Engine, defect)

Firefox 83
Desktop
Windows 7
defect

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
firefox83 --- affected

People

(Reporter: darth_stewie1, Unassigned)

Details

Attachments

(1 file)

Attached file memory-report.json.gz

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0

Steps to reproduce:

Opened a youtube video in safe mode

Actual results:

Steady climb of system usage to large amounts of total memory.

Expected results:

A small usage of memory at most.

I have attempted to reproduce this issue with a Windows 7 machine, Firefox Release v83.0 with these steps:

  1. Open browser in safe mode.
  2. Open a youtube music video in 2k video quality and go full screen.
  3. Open Windows task Manager and watch the Memory numbers of the firefox.exe events.

Result: The numbers of one specific event would go about as high as 400.000 K and it would fluctuate around that number until the video would end resulting in a sudden drop in memory usage.
In my opinion, this does not seem like an issue, but I would like to investigate some more.

Please answer these questions:

  1. Are these the system and browser versions you used when finding this issue?
  2. What are your exact steps to reproduce? How did you find this issue?
  3. Which version of Firefox did not reproduce this issue or what do you compare these results with?
  4. How small would you expect the memory usage to be?

Thank you for your contribution!

Component: Untriaged → Memory Allocator
OS: Unspecified → Windows 7
Product: Firefox → Core
Hardware: Unspecified → Desktop
Flags: needinfo?(darth_stewie1)

Oh thank God, I'm not the only one with this problem. I came here to file a bug about this and decided to run a quick search and this bug came up. I'll do my best to explain my issue with YouTube and memory usage here.

My OS is Windows 10 Pro 2004 19041.630.

Here is the version of Firefox I use as my main browser:
Firefox 84.0b6
pre-YouTube: 2652 MB processes open: 13
post-YouTube: 7210 MB processes open: 13
windows: 5
Tabs: 3552

Here is the other browsers on my system:
Google Chrome 87.0.4280.66 (Official Build) beta (64-bit)
pre-YouTube: 655 MB processes open: 28
post-YouTube: 800 MB processes open: 29
windows: 1
Tabs: 32

Microsoft Edge 44.19041.423.0 with EdgeHTML 18.19041
pre-YouTube: 465 MB processes open: 7
post-YouTube: 725 MB processes open: 11
windows: 1
Tabs: 1

Microsoft Edge 87.0.664.52 (Official build) beta (64-bit)
pre-YouTube: 318 MB processes open: 9
post-YouTube: 514 MB processes open: 10
windows: 1
Tabs: 1

Opera 72.0.3815.320 (Edition avira-2)
pre-YouTube: 353 MB processes open: 18
post-YouTube: 533 MB processes open: 18
windows: 1
Tabs: 3

Firefox 84.0b6 Developer Edition
pre-YouTube: 279 MB processes open: 7
post-YouTube: 440 MB processes open: 8
windows: 2
Tabs: 94

None of these are really clean profiles. The only difference between Firefox 84.0b6 and Firefox 84.0b6 Developer Edition is the number of windows with tabs open. It seems strange that just opening YouTube's main page (or any specific video page) causes YouTube to just shoot through the roof just because I have other windows with tabs open in Firefox. YouTube is a memory hog no matter what browser, but extra memory usage of 150 MBs to 250 MBs on other browsers is a lot different from extra memory usage of 4560 MBs.

Also, when I tried to use the Memory Snapshot in Developer Tools to take a 'picture' of the start of the YouTube load and end of the YouTube load to compare the two, I noticed a huge Byte increase under "js:BaseScript". Both "base.js" and "desktop_polymer_force_promise_polyfill.js" looked like they had the largest change in memory usage.

I'm fairly certain that none of this is as helpful as I wish it could be, but I hope that it leads to Mozilla's developers an edge case that's causing headaches in Firefox. Years ago, developers were able to find and fix a weird memory bug with Firefox that caused its shut down to hang on high tab and window profiles.

Andrew, Eric, could you look over this memory report and have an opinion on this bug? Thanks.
Any guidance on how to properly read or investigate memory issues would be greatly appreciated.

Flags: needinfo?(ericrahm+bz)
Flags: needinfo?(continuation)

Sure, I can take a look. Eric no longer works at Mozilla so he's probably not the best person to needinfo for things.

Flags: needinfo?(ericrahm+bz)

That is a colossal amount of memory. About 6GB for YouTube. About a gig of baseline/fallback-stubs, another gig of JS classes. Half a gig of baseline/optimized-stubs. About 700MB of text and other DOM nodes. 144k event listeners. So YouTube is doing a lot of something. I'm not sure what the next step would be. Maybe somebody on the JS team can reproduce this and figure out what is going wrong.

Component: Memory Allocator → JavaScript Engine
Flags: needinfo?(continuation)
Severity: -- → S3

Quick question, did something get updated with regard to YouTube either on Firefox's side or Google's side? I just opened the website to watch a video and everything seemed to be 'normal' and there wasn't a huge spike in memory usage.

Reporter, do you still observe the issue reproducing?

(In reply to kten50 from comment #6)

Quick question, did something get updated with regard to YouTube either on Firefox's side or Google's side? I just opened the website to watch a video and everything seemed to be 'normal' and there wasn't a huge spike in memory usage.

Thanks for the update. I don't think we've released a new version of Firefox recently. It is possible this was a leak on YouTube's side that they fixed, or maybe they are now serving you a different version of the code that doesn't have the issue. If you have addons, it is possible that one of those updated and changed something.

The bug has a release status flag that shows some version of Firefox is affected, thus it will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Redirect a needinfo that is pending on an inactive user to the triage owner.
:sdetar, since the bug has recent activity, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(darth_stewie1) → needinfo?(sdetar)

Unfortunately this isn't actionable without more information, and so much has changed in the last year or so anyways.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(sdetar)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: