Ghost window when closing about:debugging tab while still connected to a device
Categories
(DevTools :: about:debugging, defect, P2)
Tracking
(Not tracked)
People
(Reporter: mstange, Unassigned)
Details
Attachments
(1 file)
Bug 1617015 - WIP: Fix memory leak when closing aboutdebugging without disconnecting from the device
(deleted),
text/x-phabricator-request
|
Details |
Steps to reproduce:
- Set
memory.ghost_window_timeout_seconds
to 0 on about:config. - Click Measure on about:memory, and make sure that the
ghost-windows
measurement for the Main Process reports zero. - Open about:debugging, connect to an Android Firefox browser on a USB-connected Android device, and select that device.
- Close the about:debugging tab, without disconnecting from the device.
- Go to about:memory again, wait a second, click the buttons GC, CC, GC, CC, wait ten more seconds, and click Measure.
Expected results:
There should be no ghost windows.
Actual results:
1 (100.0%) -- ghost-windows
└──1 (100.0%) ── about:debugging#/runtime/ZY322HN5D2|%40org.mozilla.fenix.debug%2Ffirefox-debugger-socket
If I reopen the about:debugging tab, click Disconnect, and close the tab, then the ghost window goes away.
There's some documentation of ghost windows in nsWindowMemoryReporter.h:
https://searchfox.org/mozilla-central/rev/5a10be606f2d76ef22f1f44565749490de991d35/dom/base/nsWindowMemoryReporter.h#22-54
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
Thanks for the detailed report! Interestingly, this only reproduces with USB runtimes (local network runtime didn't leak any window).
I attached a small work in progress that fixes the issue. It looks that mainly, the async destroy prevents from cleanly removing events when destroying the page. I've wanted to make this sync for a long time but never got around doing it. The current patch is really not a clean take on this, but illustrates the idea.
Updated•5 years ago
|
Updated•4 years ago
|
Comment 3•4 years ago
|
||
S1 or S2 bugs needs an assignee - could you find someone for this bug?
Updated•4 years ago
|
Updated•4 years ago
|
Description
•