Repository navigation
fix(interpreter): release removed subtrees and owned subscriptions - #5895
Open
kindintelligence wants to merge 2 commits into
Open
kindintelligence wants to merge 2 commits into
kindintelligence wants to merge 2 commits into
Conversation
kindintelligence
marked this pull request as draft
October 6, 2026 04:38
kindintelligence
force-pushed
the
fix/interpreter-subtree-cleanup
branch
from
October 6, 2026 04:48
6a0937e to
a8461dc
Compare
kindintelligence
marked this pull request as ready for review
October 6, 2026 04:48
LucaCappelletti94
left a comment
There was a problem hiding this comment.
Premising that the retireSubtree approach seems okay and the leak is indeed real, at its current size the PR is pretty hard to review.
This PR in my opinion can be at least split in 3 parts, along the following seams:
- The subtree cleanup in
core.ts - The mounted queue from
WebsysDominto the interpreter - The
suspense-carousel.spec.jsrewrite, which fixes a flaky test which I believe is unrelated to the leak.
For the tests, a few cases added to the existing packages/playwright-tests suite would cover the regression without a second Playwright config, avoiding most of the bloat.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unmounting a component removes its DOM from the page, but the interpreter can retain descendant nodes, event listeners and observer registrations. Repeated mount/unmount cycles accumulate these references and grow memory usage.
This patch clears removed subtree bindings and subscriptions while preserving template prototypes and moved nodes. It also prevents stale mounted callbacks when node IDs are reused.
Targets Dioxus 0.8 alpha. Verified with 48 cleanup tests across Chromium and WebKit, plus Wasm and hydration checks.