Closed
Bug 1052138
Opened 11 years ago
Closed 7 months ago
Periodically purge weak dead listeners from nsFrameMessageManager
Categories
(Core :: DOM: Content Processes, defect, P5)
Core
DOM: Content Processes
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: mccr8, Unassigned)
References
Details
(Whiteboard: dom-lws-bugdash-triage)
The logs in bug 1051051, from a long-running automated test, show 5,076 weak dead listeners in an nsFrameMessageManager. I think the way these are normally cleared is that when a particular message comes in we clear out any dead weak listeners we find. The drawback of this is that if we never send that particular message (as we'll often get with simple automated testing that opens apps but never does anything with them) that these weak dead listeners will just stick around.
This isn't the hugest deal, but various things that have to deal with these arrays will get slower over time if we leave it alone.
I think the easiest way to deal with this is to just periodically purge it. We iterate over this list every time we CC anyways, so adding an "else" clause in, say, CycleCollectorMarkListeners, should be pretty cheap.
We just need to make sure the removal operation is cheap. Right now I think we shift the entire array, but I think order doesn't matter so we could swap the dead weak element with the end of the array, then swap (with some corner case for when the last element is weak dead though it would just get caught in the next round so not a big deal I think). This cheaper removal could be used other places RemoveElement is being called I guess.
jlebar wanted to do Bug 901753.
Reporter | ||
Comment 2•11 years ago
|
||
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #1)
> jlebar wanted to do Bug 901753.
Yeah, that would be a more pure fix, but it looks quite complex, and way overkill for observer/listener kind of stuff that only gets slowly added to and that we're iterating over anyways.
Comment 3•7 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
Updated•3 years ago
|
Severity: normal → S3
Comment 4•7 months ago
|
||
The function CycleCollectorMarkListeners
cited in the description does not even exist anymore. Is this bug still a thing?
Flags: needinfo?(continuation)
Updated•7 months ago
|
Whiteboard: dom-lws-bugdash-triage
Reporter | ||
Comment 5•7 months ago
|
||
I think it means adding something to nsFrameMessageManager::MarkForCC() or the like, but I don't think anybody has noticed a problem here recently, so let's just close this. I'd expect that there are a lot less message managers nowadays.
Status: NEW → RESOLVED
Closed: 7 months ago
Flags: needinfo?(continuation)
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•