It seems that [`nsDocShell::Destroy`](https://crash-stats.mozilla.org/search/?release_channel=nightly&signature=%3DIPCError-browser%20%7C%20ShutDownKill&proto_signature=~nsDocShell%3A%3ADestroy&product=Firefox&version=115.0a1&date=%3E%3D2023-05-24T00%3A00%3A00.000Z&date=%3C2023-06-02T09%3A15%3A00.000Z&_facets=url&_facets=user_comments&_facets=install_time&_facets=version&_facets=address&_facets=moz_crash_reason&_facets=reason&_facets=build_id&_facets=platform_pretty_version&_facets=ipc_shutdown_state&_sort=-date&_columns=date&_columns=signature&_columns=product&_columns=version&_columns=build_id&_columns=platform&_columns=ipc_shutdown_state#crash-reports) is pretty common on these stacks. Among those, [`ServoStyleSet::ShellDetachedFromDocument`](https://searchfox.org/mozilla-central/rev/87ba454e5c68ff77dff9acb9d7b0b51d6df12d11/layout/style/ServoStyleSet.cpp#143) has a decent percentage. Am I right in assuming that this function is only freeing memory? Could we just detach the `ServoStyleSet` object from the `PresShell` and post an event to the main thread to free the memory asynchronously?
Bug 1809115 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
It seems that [`nsDocShell::Destroy`](https://crash-stats.mozilla.org/search/?release_channel=nightly&signature=%3DIPCError-browser%20%7C%20ShutDownKill&proto_signature=~nsDocShell%3A%3ADestroy&product=Firefox&version=115.0a1&date=%3E%3D2023-05-24T00%3A00%3A00.000Z&date=%3C2023-06-02T09%3A15%3A00.000Z&_facets=url&_facets=user_comments&_facets=install_time&_facets=version&_facets=address&_facets=moz_crash_reason&_facets=reason&_facets=build_id&_facets=platform_pretty_version&_facets=ipc_shutdown_state&_sort=-date&_columns=date&_columns=signature&_columns=product&_columns=version&_columns=build_id&_columns=platform&_columns=ipc_shutdown_state#crash-reports) is pretty common on these stacks. Among those, [`ServoStyleSet::ShellDetachedFromDocument`](https://searchfox.org/mozilla-central/rev/87ba454e5c68ff77dff9acb9d7b0b51d6df12d11/layout/style/ServoStyleSet.cpp#143) has a decent percentage. Am I right in assuming that this function is only freeing memory? Could we just detach the `ServoStyleSet` object from the `PresShell` and post an event to the main thread to free the memory asynchronously? And `if(ProcessChild::ExpectingShutdown()` we could even do something with `ClearOnShutdown` here to do it even later.