Closed Bug 1406923 Opened 4 years ago Closed 2 years ago
.xul leak in extensions/ext-browser .js
I found I had a browser.xul window leak in FF57 beta today. I analyzed the GC/CC logs and found that its being held alive via TabTracker's _tabIds property in ext-browser.js. bkelly@valen:/mnt/c/devel/tmp/cclogs$ /mnt/c/devel/heapgraph/find_roots.py cc-edges.13384.1507553472.log 0000019D681B5800 Parsing cc-edges.13384.1507553472.log. Done loading graph. 0000019D6989D060 [JS Object (Window)] --[UnwrapDOMObject(obj)]--> 0000019D681B5800 [nsGlobalWindow # 29 inner chrome://browser/content/browser.xul] Root 0000019D6989D060 is a marked GC object. bkelly@valen:/mnt/c/devel/tmp/cclogs$ /mnt/c/devel/heapgraph/find_roots.py gc-edges.13384.1507553472.log -bro 0000019D6989D060 Parsing gc-edges.13384.1507553472.log. Done loading graph. via mCallback : 0000019D71780080 [Proxy <no private>] --[proxy target]--> 0000019D63906F80 [Object <no private>] --[_tabIds]--> 0000019D6392E180 [Proxy <no private>] --[proxy target]--> 0000019D6392E200 [Map 0000019D5FF12E20] --[value]--> 0000019D6EDEA600 [Proxy <no private>] --[proxy target]--> 0000019D70DF8730 [XULElement <no private>] --[group]--> 0000019D69882E20 [object_group] --[group_global]--> 0000019D6989D060 [Window <no private>] The only non-standard addon I have installed is the multi-account containers addon. I don't think that is a web-extension, though.
Actually, it does seem to be related to multi-account container addon. STR: 1. Open a new browser window. 2. Open a container tab in that window. 3. Load a content page in the container tab. I used example.com. 4. Close the window with the container tab still active. 5. Open about:memory in another window/tab in same session. 6. Minimize and measure. You will observer an increasing amount of browser.xul memory under detached windows in the parent process. Kris, does this look like a platform issue or a problem with the addon itself?
:bkelly could you try opening the addon as a web extension using the web-ext command? https://github.com/mozilla/multi-account-containers/blob/master/README.md#web-extension-development We inject content scripts but I think we rely on Firefox to do memory cleanup. This to me seems like a Firefox issue but perhaps we can mitigate somehow.
This is 100% reproduceable for me. Does it not happen for you? I'm not sure when I will have time to do any investigation here. I'm a bit slammed at the moment.
It looks like a platform issue. Apparently we're not getting a tab removed event for the tab.
Assignee: nobody → kmaglione+bmo
Component: WebExtensions: Untriaged → WebExtensions: Frontend
Thanks for taking this. It would be great to include a test like this as part of the fix: https://dxr.mozilla.org/mozilla-release/source/addon-sdk/source/test/leak/leak-utils.js#38
This would show up in regular window leak checks if it were happening during tests. That map is global, and lasts until the end of the browser session.
Kris, are you still looking into this?
Yes, but I've had higher priorities for the past few weeks.
Assignee: kmaglione+bmo → nobody
Priority: P2 → P3
Whiteboard: [MemShrink:P2] → [MemShrink:P2], webext?
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.