Open Bug 1945363 Opened 11 days ago Updated 6 days ago

Very high memory usage (4GB) on YouTube

Categories

(Core :: Performance, defect)

Firefox 134
defect

Tracking

()

UNCONFIRMED

People

(Reporter: alex, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(6 files)

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

Steps to reproduce:

  1. Leave a scheduled youtube stream open or simply watch the stream and/or send a message in the chat
  2. Wait

Actual results:

Memory usage increases greatly and the browser/youtube become less responsive and live streams freeze until the youtube tabs are unloaded and restored

A couple links to my profiles when I experienced the issue or something resembling it:
https://share.firefox.dev/40tHFzI
https://share.firefox.dev/4jopt3b

Expected results:

Memory usage and site responsiveness should have remained stable and the stream should not have experienced a freeze

I uploaded another profile because it happened on my other computer shortly after posting this. Watching a stream, froze, noticed in about:processes it shot up to using several gigabytes of memory while frozen

https://share.firefox.dev/3WIYxkJ

The Bugbug bot thinks this bug should belong to the 'Core::Performance' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Performance
Product: Firefox → Core

This bug was moved into the Performance component.

:alex, could you make sure the following information is on this bug?

  • ✅ For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
  • For memory usage issues, capture a memory dump from about:memory and attach it to this bug.
  • Troubleshooting information: Go to about:support, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.

If the requested information is already in the bug, please confirm it is recent.

Thank you.

Flags: needinfo?(alex)

OS: Windows 11 / Microsoft Windows [Version 10.0.26100.2894]
Useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0
Log recording: https://share.firefox.dev/4hIxluI

Notes: Clicking links to other videos within the youtube.com domain do not full page-load. The URL on the address line changes, but the content fails to load/change within the window, and the loading bar does not completely traverse from left-to-right. Reloading (CTRL+R) the page allows the URL/page to subsequently load completely. Clicking on non-media links within the youtube.com domain otherwise work fine. Opening media links into new tabs or new windows works fine. It's only problematic when it's a same-window rendering of a clicked lick.

Attached file memory-report.json.gz
Flags: needinfo?(alex)
Attached file about_suppoort_raw.txt

(In reply to BugBot [:suhaib / :marco/ :calixte] from comment #3)

This bug was moved into the Performance component.

:alex, could you make sure the following information is on this bug?

  • ✅ For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
  • For memory usage issues, capture a memory dump from about:memory and attach it to this bug.
  • Troubleshooting information: Go to about:support, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.

If the requested information is already in the bug, please confirm it is recent.

Thank you.

The files have been attached now that is has happened to me again while watching a live stream on youtube.

Attached file memory-report2.json.gz
Attached file about_support_raw2.txt

Kagami, please check Alex and Micheal's logs. Many users are still complaining about performance issues with YouTube.

Flags: needinfo?(krosylight)

I don't see any ghost windows from the memory report, so it's at least not directly related to bug 1939295. Can you follow the guide https://bugzilla.mozilla.org/show_bug.cgi?id=1939295#c3 and send CC logs? Thanks!

Flags: needinfo?(krosylight)
Summary: Youtube memory bug/leak still around (Bug 1939295) → Very high memory usage (4GB) on YouTube

https://share.firefox.dev/40tHFzI: In this log, there are very long CC pauses
https://share.firefox.dev/4jopt3b: In this log, the process is spending a ton of time in the GC
https://share.firefox.dev/3WIYxkJ: In this log, the process is spending a ton of time in the GC
https://share.firefox.dev/4hIxluI: In this log, the big pauses look like they are running JS associated with a WebExtension "Video DownloadHelper".

Can you reproduce the issue without addons enabled? I see a bunch of addons related to YouTube in the memory report, in addition to the profile spending time in Video DownloadHelper.

The memory report shows a ton of memory in a single window, so there's some kind of leak.

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #11)

I don't see any ghost windows from the memory report, so it's at least not directly related to bug 1939295. Can you follow the guide https://bugzilla.mozilla.org/show_bug.cgi?id=1939295#c3 and send CC logs? Thanks!

Let's not do that for now. I'm not sure how useful it will be for now.

Flags: needinfo?(alex)

(In reply to Andrew McCreight [:mccr8] from comment #12)

https://share.firefox.dev/40tHFzI: In this log, there are very long CC pauses
https://share.firefox.dev/4jopt3b: In this log, the process is spending a ton of time in the GC
https://share.firefox.dev/3WIYxkJ: In this log, the process is spending a ton of time in the GC
https://share.firefox.dev/4hIxluI: In this log, the big pauses look like they are running JS associated with a WebExtension "Video DownloadHelper".

Can you reproduce the issue without addons enabled? I see a bunch of addons related to YouTube in the memory report, in addition to the profile spending time in Video DownloadHelper.

The memory report shows a ton of memory in a single window, so there's some kind of leak.

(In reply to Kagami Rosylight [:saschanaz] (they/them) from comment #11)

I don't see any ghost windows from the memory report, so it's at least not directly related to bug 1939295. Can you follow the guide https://bugzilla.mozilla.org/show_bug.cgi?id=1939295#c3 and send CC logs? Thanks!

Let's not do that for now. I'm not sure how useful it will be for now.

I'm running my browser in troubleshooting mode right now and I have seen the memory usage rise up to 3gb so far.

Flags: needinfo?(alex)

I'm using two separate machines In troubleshooting mode without addons disabled, and I'm seeing memory in about:processes continue to rise into the 4gb and higher range on both, so I uploaded the profile and the previously requested files again under those conditions.

I've seen it shoot quickly up to 6gb in the past well, and the stream freezes at that point.

https://share.firefox.dev/4hIuMsw

Here's the profile from the second machine as well. Prior to the point of recording I received a warning from firefox saying the stream page was slowing down my browser.

https://share.firefox.dev/4huxYsc

Thanks for checking that.

  1. Are these all "live" streams on YouTube?
  2. Do they all have active chats going?
  3. Do you have the YouTube tab in the foreground so the video is fully visible, or maybe it is in a background tab or a minimized window (we've had problems with the latter before)?
Flags: needinfo?(alex)

Also, how long does it typically take to end up using that much memory? Like, under a minute, 10 minutes, an hour, multiple hours, etc?

(In reply to Andrew McCreight [:mccr8] from comment #18)

Thanks for checking that.

  1. Are these all "live" streams on YouTube?
  2. Do they all have active chats going?
  3. Do you have the YouTube tab in the foreground so the video is fully visible, or maybe it is in a background tab or a minimized window (we've had problems with the latter before)?
  1. They are not always "live". Sometimes they are just scheduled, with people waiting for the streamer to arrive at a later time.
  2. The chat is available with users occasionally sending messages.
  3. I've experienced the issue with the tab in the foreground and visible, though I may be active in another smaller firefox window at the same time. I have also experienced the issue while having the tab in the background while watching a video in another tab.

(In reply to Andrew McCreight [:mccr8] from comment #19)

Also, how long does it typically take to end up using that much memory? Like, under a minute, 10 minutes, an hour, multiple hours, etc?

I've seen it happen within a few minutes. Right now during testing, it was less than an hour.

However, I've also had situations where I did not notice any performance issues for several hours.

Flags: needinfo?(alex)

Actually, I sent a message in the chat roughly when I started testing so I can figure out how long it took this time based on the time I saved the link to my profile and the time I started testing.

It appears it took 23 minutes.

I'm experiencing what seems to be the same issue on Manjaro (KDE Plasma, Wayland), happens both on Firefox 134 and persists in 135. As advised on the Reddit thread, I captured my media performance profile, available at the following link:

https://profiler.firefox.com/public/02fh0vxnnmwn1zrzjk48xqmg553d58e9c57d2s0/calltree/?globalTrackOrder=0w3&thread=a&v=10

Note that I don't experience the performance loss and 100% CPU use during playback: It occurs whenever a Youtube tab loads including the main page. After about 30 seconds of opening a tab everything returns to normal, memory usage does increase over time.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: