Ghost windows on soundcloud
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr60 | --- | unaffected |
firefox67 | --- | wontfix |
firefox67.0.1 | --- | wontfix |
firefox68 | --- | wontfix |
firefox69 | --- | verified |
People
(Reporter: over68, Assigned: pehrsons)
References
(Regression)
Details
(Keywords: memory-leak, regression, Whiteboard: [MemShrink])
Attachments
(3 files)
Steps to reproduce:
- Go to about:preferences#general
- Disable "Use recommended performance settings"
- Set "Content process limit" to "1"
- Restart Firefox.
- Open http://example.com/ in first tab.
- Open https://soundcloud.com/kapslap/summer-mix-2015 in second tab.
- Play the song.
- Close the second tab.
- Wait two minutes, then go to 'about:memory' then press 'Measure'.
Actual results:
Ghost windows on soundcloud.
│ ├──10.05 MB (07.86%) -- top(none)/ghost/window(https://soundcloud.com/kapslap/summer-mix-2015)
Regression range:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=f85343663811990b19cecb27b7c0beba0448309a&tochange=6be5d281ae921fca461799ba5168599b480cd7e5
Regressed by: bug 1423241
Assignee | ||
Comment 2•5 years ago
|
||
I can confirm that this is happening. I haven't confirmed the regressor yet.
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
The regressor moved ownership of MediaStreams and MediaStreamTracks to OutputStreamManager, which is owned by MediaDecoder. When you close a tab, the media elements in that tab become inactive and their associated MediaDecoders are paused and suspended, but not shut down. Because they're not shut down, they stay ready to continue capturing data into any MediaStreams previously returned by mozCaptureStream (which soundcloud uses).
Normally these MediaStreams and MediaStreamTracks would be eligible to be cycle collected, but since MediaDecoder (and its descendant OutputStreamManager) doesn't participate in CC, a reference is left-hanging somewhere here which keeps both the HTMLMediaElement, and MediaStreams and MediaStreamTracks alive until XPCOM_Shutdown, when the MediaShutdownManager shuts the MediaDecoder down.
I have a patch in progress that makes the strong refs to MediaStreams and MediaStreamTracks in OutputStreamManager weak refs instead. That fixes this issue.
Assignee | ||
Comment 5•5 years ago
|
||
Assignee | ||
Comment 6•5 years ago
|
||
Depends on D36569
Assignee | ||
Comment 7•5 years ago
|
||
MediaInputPort::Destroy must always be called, or it will not remove its strong
ref to the MediaStreamGraph. The guard is not even needed, since
MediaInputPort::Disconnect is idempotent.
Depends on D36570
Comment 9•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6e2e6b0b0dc5
https://hg.mozilla.org/mozilla-central/rev/e1f73a7e8dc6
https://hg.mozilla.org/mozilla-central/rev/e3b2bdab221f
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Confirmed issue with 69.0a1(20190614215040).
Fix verified with 69.0b5 on Windows 10, macOS 10.13, Ubuntu16.04; no ghosts appeared even after a ~5 minute interval.
Updated•3 years ago
|
Description
•