Closed
Bug 919244
Opened 11 years ago
Closed 10 years ago
ghost-windows appears on https://apprtc.appspot.com/ after execute "Minimize memory usage"
Categories
(Core :: WebRTC: Audio/Video, defect)
Tracking
()
VERIFIED
FIXED
mozilla29
People
(Reporter: alice0775, Assigned: jib)
References
Details
(Whiteboard: [MemShrink:P2])
Attachments
(1 file, 1 obsolete file)
16.31 KB,
patch
|
jib
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Steps To Reproduce. 1. Open https://apprtc.appspot.com/ in new tab 2. Close the tab 3. Open about:memory and Click "Measure" --- observe ghost-windows 4. Click "GC" and Click "Measure" --- observe ghost-windows 5. Click "CC" and Click "Measure" --- observe ghost-windows 6. Click "Minimize memory usage" and Click "Measure" --- observe ghost-windows Actual Results: After Step 6, Two ghost-windows appears
Updated•11 years ago
|
Whiteboard: [MemShrink]
Seems likely to be a webrtc issue.
Component: General → WebRTC
Comment 2•11 years ago
|
||
I failed to reproduce on Linux (trunk build, where I don't have a camera) or Mac (FF 24 beta, where I do). Maybe it's a Windows-only issue?
Reporter | ||
Comment 3•11 years ago
|
||
I can also reproduce on ubuntu 12.04. ttp://hg.mozilla.org/mozilla-central/rev/8b4d14afc4f6 Mozilla/5.0 (X11; Linux i686; rv:27.0) Gecko/20100101 Firefox/27.0 ID:20130922030201
OS: Windows 7 → All
Comment 4•11 years ago
|
||
I didn't make a connection -- do you need to make a connection to reproduce?
Reporter | ||
Comment 5•11 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #4) > I didn't make a connection -- do you need to make a connection to reproduce? What is "connection"? Just follow STR with new profile. It happens regardless of having camera or not.
Comment 6•11 years ago
|
||
I finally got this to repro on OS X also. One note on the STR is that the problem does not seem to arise if you acknowledge the microphone / camera doorhanger. You must close the page with that doorhanger open. I also note that the issue will repro just fine using this test page, which uses gUM but not PeerConnection: http://mozilla.github.io/webrtc-landing/gum_test.html I used the "video-only" mode, but I suspect others have the same result. Assigning more specifically to "Audio/Video."
Component: WebRTC → WebRTC: Audio/Video
Comment 7•11 years ago
|
||
Ok, sounds like this is the cause of the leak that causes bug 917491 (same STR - don't answer a permission doorhanger; world leaks)
Comment 8•11 years ago
|
||
(In reply to Randell Jesup [:jesup] from comment #7) > Ok, sounds like this is the cause of the leak that causes bug 917491 (same > STR - don't answer a permission doorhanger; world leaks) Sorry - not necessarily the same, but related
Comment 9•11 years ago
|
||
> One note on the STR is that the
> problem does not seem to arise if you acknowledge the microphone / camera
> doorhanger. You must close the page with that doorhanger open.
Ah, I acknowledged that before closing the tab.
Trying again, the doorhanger no long appears (even if I try a new profile?!) but I do get the 2 ghost windows.
Comment 10•11 years ago
|
||
jesup, ghost windows are pretty bad. Any idea who might be able to work on this?
Whiteboard: [MemShrink] → [MemShrink:P2]
Comment 11•11 years ago
|
||
The same thing is happening on chat.meatspac.es. I looked at a log, and there are two nsXPCWrappedJS (nsIDOMGetUserMediaSuccessCallback) objects holding everything alive. The XPCWJS has two references, one the self reference, and one unknown reference that is holding everything alive.
Assignee | ||
Comment 12•11 years ago
|
||
Seems related to Bug 949907.
Comment 13•11 years ago
|
||
jib: can you investigate this one? At least to the point of deciding if it's related to bug 949907
Flags: needinfo?(jib)
Assignee | ||
Updated•11 years ago
|
Flags: needinfo?(jib)
Assignee | ||
Comment 15•10 years ago
|
||
Two things needed to be fixed: 1. OnNavigation now cleans up mActiveCallbacks (a coat-check for gUMRunnables) 2. gUMRunnable now cleans up its JS callbacks unless it's "armed" for dispatch. I also added a comment on MediaManager's refcounting strategy for runnables off main: * GetUserMediaRunnable is meant for dispatch off main thread, where it would * be illegal to free JS callbacks. Therefore, it uses a rather risky strategy * of holding "already_AddRefed" references to the JS callbacks that must be * transfered and released in consequent dispatches arriving on main thread. * * A special Arm() method must be called before dispatch to enable this * behavior, because gUMRunnables are held in other circumstances.
Attachment #8356574 -
Flags: review?(rjesup)
Assignee | ||
Comment 17•10 years ago
|
||
Try - https://tbpl.mozilla.org/?tree=Try&rev=b2570e11d47a
Comment 18•10 years ago
|
||
Comment on attachment 8356574 [details] [diff] [review] Leakproof gUMRunnable + OnNavigation cleanup of MediaManager::mActiveCallbacks Review of attachment 8356574 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/media/MediaManager.cpp @@ +814,5 @@ > } > } > > + void > + Arm() { Comment what Arm() is doing (I know it's discussed above). @@ +1666,5 @@ > return NS_OK; > > } else if (!strcmp(aTopic, "getUserMedia:response:allow")) { > nsString key(aData); > + nsRefPtr<GetUserMediaRunnable> gUMRunnable; Lets change gUMRunnable to gum_runnable to avoid confusion with the gFoo naming convention for globals. (and below as well). I realize it predated this change, but since we need to expand it and duplicate it, let's rename.
Attachment #8356574 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 19•10 years ago
|
||
Added comments and renamed "gUMRunnable" to just "runnable" (which became available with this patch). Carrying forward r+ from jesup.
Attachment #8356574 -
Attachment is obsolete: true
Attachment #8357383 -
Flags: review+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Comment 20•10 years ago
|
||
See also https://bugzilla.mozilla.org/show_bug.cgi?id=951491#c15 and https://bugzilla.mozilla.org/show_bug.cgi?id=951491#c12
Comment 21•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cad9ce8315a4
Status: NEW → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Assignee | ||
Comment 23•10 years ago
|
||
The leak has been there since the gUM permission prompt was introduced AFAIK, so it's not a regression per se. But clearly the sooner the fix appears in users' hands the better. What's customary?
Flags: needinfo?(jib)
Comment 26•10 years ago
|
||
I'd say nominate it for Aurora. Not a major problem if it's not accepted, as it's a memory leak issue.
Flags: needinfo?(rjesup)
Comment 27•10 years ago
|
||
This kind of memory leak is increasing cycle collections times, so it may cause significant jank.
Assignee | ||
Comment 28•10 years ago
|
||
Comment on attachment 8357383 [details] [diff] [review] Leakproof gUMRunnable + OnNavigation cleanup of MediaManager::mActiveCallbacks (2) r=jesup [Approval Request Comment] Bug caused by (feature/regressing bug #): gUM permission prompt feature. User impact if declined: Window leak. Increased cycle collection times, jank. Testing completed (on m-c, etc.): Landed on m-c two weeks ago. Verified locally. Risk to taking this patch (and alternatives if risky): Low. Just MediaManager, no dependencies. String or IDL/UUID changes made by this patch: None
Attachment #8357383 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
Attachment #8357383 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 29•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/29a536174b77
status-b2g-v1.3:
--- → fixed
status-b2g-v1.4:
--- → fixed
status-firefox27:
--- → wontfix
status-firefox28:
--- → fixed
status-firefox29:
--- → fixed
Comment 30•10 years ago
|
||
Verified as fixed on Firefox 28 beta 1 (20140205162153) and latest Aurora 29.0a2 (20140205004001) under Win 7 64-bit, Ubuntu 32-bit and Mac OSX 10.8.5.
You need to log in
before you can comment on or make changes to this bug.
Description
•