#871 Try to reduce CC overzealousness when dealing with ghost windows

Open
opened 2 years ago by wolfbeast · 1 comments
wolfbeast commented 2 years ago (Migrated from github.com)

See https://forum.palemoon.org/viewtopic.php?f=3&t=20843

Apparently GMail leaks a pretty hefty chunk of web worker JS in its new design when closing the tab. This becomes detached and eventually ghost code that the CC will try to clean up. The same goes for ghost windows/documents of other websites that do not clean up properly.
This is potentially disastrous for performance if the CC “overworks” itself trying to clean up ghost windows that are likely going to be leaked forever anyway. Removing these leaked objects from the CC graph will reduce CC pressure considerably; we may want to re-include these objects once in a rare CC run afterwards to see if the ghost objects have been released yet or not. Say, one in 100 or so.

See https://forum.palemoon.org/viewtopic.php?f=3&t=20843 Apparently GMail leaks a pretty hefty chunk of web worker JS in its new design when closing the tab. This becomes detached and eventually ghost code that the CC will try to clean up. The same goes for ghost windows/documents of other websites that do not clean up properly. This is potentially disastrous for performance if the CC "overworks" itself trying to clean up ghost windows that are likely going to be leaked forever anyway. Removing these leaked objects from the CC graph will reduce CC pressure considerably; we may want to re-include these objects once in a rare CC run afterwards to see if the ghost objects have been released yet or not. Say, one in 100 or so.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

I’ve been unable to slot this all together as intended because of the complex interrelationships of nsIDOMWindow, nsPIDOMWindow, nsGlobalWindow and the various *Inner and *Outer variants of them. The idea was to add a simple bool flag on the inner window objects to mark if they were ghost windows or not so they could be skipped, but I’ve been unable to do this in a way that satisfies the C++ class hierarchy in place while still being callable from the necessary calling sites to set/check ghost status.

If anyone else thinks they have the necessary information about these structures to make this work, please feel free to step in and lend a hand. Marking this as On Hold for now.

I've been unable to slot this all together as intended because of the complex interrelationships of `nsIDOMWindow`, `nsPIDOMWindow`, `nsGlobalWindow` and the various `*Inner` and `*Outer` variants of them. The idea was to add a simple `bool` flag on the inner window objects to mark if they were ghost windows or not so they could be skipped, but I've been unable to do this in a way that satisfies the C++ class hierarchy in place while still being callable from the necessary calling sites to set/check ghost status. If anyone else thinks they have the necessary information about these structures to make this work, please feel free to step in and lend a hand. Marking this as `On Hold` for now.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.