Bug 1809115 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We revisited content process shutdown in bug 1728331 and [it seems](https://bugzilla.mozilla.org/show_bug.cgi?id=1728331#c19) that the changes from bug 1809134 are not really needed.

This means we cannot rely on `ProcessChild::ExpectingShutdown()` having been called before `RecvDestroy` runs, but its result can change at any time in parallel, so periodically checking it would still work to abort long running tasks, if we think this helps with anything.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

> (In reply to Jens Stutte [:jstutte] from comment #2) 
> > Am I right in assuming that this function is only freeing memory?
> 
> For the most part, it also updates the DOM state etc.
> 
> > Could we just detach the `ServoStyleSet` object from the `PresShell` and post an event to the main thread to free the memory asynchronously?
> 
> Yes, though not trivially because it calls into code that needs to otherwise run sync from e.g. DOM node removal... Is the slow part freeing the memory? Or going through the DOM cleaning up styles? Or something else?

I think the best course of action remains to understand, what actually causes the load here. There might be some potential for improvements that could even affect also normal operations, especially if there is some hidden quadratic runtime caused by some nesting hitting us only for large trees or similar.
We revisited content process shutdown in bug 1728331 and [it seems](https://bugzilla.mozilla.org/show_bug.cgi?id=1728331#c19) that the changes from bug 1809134 are not really needed.

This means we cannot rely on `ProcessChild::ExpectingShutdown()` having been set before `RecvDestroy` runs, but its result can change at any time in parallel, so periodically checking it would still work to abort long running tasks, if we think this helps with anything.

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

> (In reply to Jens Stutte [:jstutte] from comment #2) 
> > Am I right in assuming that this function is only freeing memory?
> 
> For the most part, it also updates the DOM state etc.
> 
> > Could we just detach the `ServoStyleSet` object from the `PresShell` and post an event to the main thread to free the memory asynchronously?
> 
> Yes, though not trivially because it calls into code that needs to otherwise run sync from e.g. DOM node removal... Is the slow part freeing the memory? Or going through the DOM cleaning up styles? Or something else?

I think the best course of action remains to understand, what actually causes the load here. There might be some potential for improvements that could even affect also normal operations, especially if there is some hidden quadratic runtime caused by some nesting hitting us only for large trees or similar.

Back to Bug 1809115 Comment 5