Closed Bug 1624711 Opened 5 months ago Closed 5 months 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

(Blocks 1 open bug, 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
Duplicate of this bug: 1624226
Status: ASSIGNED → RESOLVED
Closed: 5 months 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
You need to log in before you can comment on or make changes to this bug.