Closed Bug 1582124 Opened 5 years ago Closed 5 years ago

Investigate breaking Document cycles when they are destroyed

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(1 file)

While investigating bug 1576829 and bug 1579796 I saw Document objects living on after I expected them to die. This was caused by garbage cycles involving the mReadyForIdle promise (the reason is that Promise has a pointer to the script global, which has a pointer back to the document). This means that Documents don't die until we run a cycle collection and since this also holds the JS zone live a lot of garbage can build up.

Possibly we should try to break these cycles when we know a document is being destroyed.

This patch nulls out a Document's promises when it is destroyed to break cycles going through them and ensure Documents are cleaned up sooner. I'm not entirely sure this is right, but it works on try. What do you think?

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f63bec9d3385
Break Document cycles when they are destroyed r=smaug
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: