Open Bug 1450430 Opened 6 years ago Updated 2 years ago

Reduce performance impact of ghost windows

Categories

(Core :: General, enhancement, P3)

enhancement

Tracking

()

Performance Impact none

People

(Reporter: bzbarsky, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

From email from Bill McCloskey:

We need a mechanism to avoid the performance problems associated with ghost windows even if we don't fix the bugs that cause them. There are two ways to go about this:

a) We could give up on ever collecting the memory for ghost windows. To do this, we could mark them black in the GC. That would mean that the CC would never have to look at them. The GC would slow down a little bit, but the CC would get a lot faster. We could even try to collect the ghost windows very infrequently (every hour or something).

b) We could assume that no one is ever going to touch the ghost window again and disconnect it from the heap. This is a little dangerous since it could cause problems (incorrect behavior or crashes) if the window is actually used later. However, the work in step 1 should make that less likely. There are a couple approaches here:

i) We could unlink the window from the heap (using the cycle collector's unlink phase).
ii) We could remove all the DOM nodes from the window. 
iii) We could somehow clear out C++ -> JS references for the window and its DOM nodes. That should cause JS objects to be freed.

Depending on what sort of reference is causing the window to leak, any of (i), (ii), or (iii) might be effective. We could do all three of them if we wanted. We could do experiments to test which ones are more effective and which ones cause crashes.
Depends on: 1388834, 1179894
Priority: -- → P3
Whiteboard: [qf:?]
Whiteboard: [qf:?] → [qf-]
Performance Impact: --- → -
Whiteboard: [qf-]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.