Closed Bug 1624711 Opened 4 years ago Closed 4 years ago

Youtube leaks closed tabs due to missing CC edge

Categories

(Core :: Audio/Video: Playback, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla76
Tracking Status
firefox-esr68 --- unaffected
firefox74 --- unaffected
firefox75 --- unaffected
firefox76 --- verified

People

(Reporter: nika, Assigned: nika)

References

(Regression)

Details

(Keywords: memory-leak, regression)

Attachments

(1 file)

Earlier today I was experiencing very poor performance when switching tabs and other actions, due to long (>5 second) CCs on YouTube, caused by us leaking ~600MB of closed window objects.

Based on CC and GC logs, I discovered YouTube was installing MediaSessionEventHandler callbacks, which are being held alive by non-traversed strong references, and causing memory leaks. It appears as though the mActionHandlers field of MediaSession (https://searchfox.org/mozilla-central/rev/c80fa7258c935223fe319c5345b58eae85d4c6ae/dom/media/mediasession/MediaSession.h#92) is not being exposed to the cycle-collector, which would explain this leak.

This should be fixed by ensuring the pointers in mActionHandlers are traversed and unlinked by the cycle-collector.

Marking bug 1620077 as the regressing bug, due to it enabling this feature on Nightly.

Assignee: nobody → alwu
Blocks: MediaSession
Priority: -- → P1
Assignee: alwu → nika
Attachment #9135519 - Attachment description: Bug 1624711 - Traverse and Unlink MediaSession::mActionHandlers, → Bug 1624711 - Traverse and Unlink MediaSession::mActionHandlers
Pushed by nlayzell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dea5a9179f87
Traverse and Unlink MediaSession::mActionHandlers r=alwu

@ :Nika Layzell - Thank you very much for diagnosing this issue!
I have identical problems, even when all tabs and windows were closed, leaving only new tab, Firefox will be using lot of CPU from time to time.
Here's profile - https://bit.ly/3agTy0H , maybe it will be useful in some way, if not, just for archive proposes.

Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76

I'm confirming that bug is fixed, starting in Mozilla Firefox Nightly 76.0a1 (2020-03-25), so I'm marking this bug as VERIFIED.
Thank you very much! \o/

Status: RESOLVED → VERIFIED
QA Contact: Virtual
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: