Run tasks after every shutdown cycle collection
Categories
(Core :: XPCOM, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(2 files)
Unlinking, such as in UnbindFromTree, can add runnables that keep alive CCed objects after they have been unlinked. In combination with some unknown fields not being traversed and unlinked this could cause intermittent shutdown leaks, if those unknown fields hold alive objects that need the CC to be collected. Work around this by clearing out these runnables after every shutdown CC.
I tried reading code related to video elements to find what might be missing, but I didn't see anything obvious. There's a lot of classes that can't be CCed because they use threadsafe refcounting, so maybe one of them can hold a video element alive somehow. This will probably be tough to figure out without DMD heap scan and CC logs that hit the leak in bug 1596532. I think I tried to do that, but the DMD slowdown was probably making it hard to repro.
Clearing the queue after every CC is a bit of a hack, but at least the leak didn't show up after 16 retriggers: https://treeherder.mozilla.org/#/jobs?repo=try&revision=82f9aa12ff4af527e6f04318dee82ba88a8b492f
The rate of this failure isn't super high normally so it is hard to say if it is really doing the trick.
Assignee | ||
Comment 1•4 years ago
|
||
This is to prepare for the next patch.
Assignee | ||
Comment 2•4 years ago
|
||
Unlinking, such as in UnbindFromTree, can add runnables that keep alive CCed
objects after they have been unlinked. In combination with some unknown
fields not being traversed and unlinked this could cause intermittent shutdown
leaks, if those unknown fields hold alive objects that need the CC to be
collected. Work around this by clearing out these runnables after every
shutdown CC.
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/80822f4dcf6f part 1 - Make nsCycleCollector::Shutdown MOZ_CAN_RUN_SCRIPT. r=smaug https://hg.mozilla.org/integration/autoland/rev/4beaa3c7e5c3 part 2 - Run tasks after every shutdown cycle collection. r=smaug
Comment 4•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/80822f4dcf6f
https://hg.mozilla.org/mozilla-central/rev/4beaa3c7e5c3
Description
•