Repository navigation
[BUGFIX lts] Release renderComponent roots (and renderers) when the result is destroyed - #21647
Merged
ef4 merged 1 commit intoOct 6, 2026
Conversation
…royed `RenderResult#destroy()` only destroyed the inner Glimmer render result, never the `ComponentRootState` that wraps it. The root stayed in the renderer's `roots` list, so the renderer was never deregistered from the global `renderers` list, which kept the root, its args and its `into` element alive forever. This is most visible when `renderComponent` is called without an owner (e.g. from a modifier): each call creates a new renderer, so every render/destroy cycle leaked a whole renderer and the detached element. Now destroying the result (or the owner) destroys the root, and a destroyed root removes itself from its renderer, deregistering the renderer once it has no roots left. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01U6oM2SghwZ7bgTerTEx2hd
Contributor
Author
|
and took a memory snapshot before clicking anything, and then clicked the button, and held down "enter" for a few dozen seconds and it looks like the problem is solved. |
NullVoxPopuli
marked this pull request as ready for review
October 1, 2026 20:16
Contributor
|
Without the fix, the two new tests fail. With the fix, all
The two failures without the fix: Each of the five render and destroy cycles leaked one renderer in the first test. To reproduce: The testem config is a copy of |
ef4
approved these changes
Oct 6, 2026
This was referenced Oct 6, 2026
Closed
kategengler
pushed a commit
that referenced
this pull request
Oct 13, 2026
…esult is destroyed `RenderResult#destroy()` only destroyed the inner Glimmer render result, never the `ComponentRootState` that wraps it. The root stayed in the renderer's `roots` list, so the renderer was never deregistered from the global `renderers` list, which kept the root, its args and its `into` element alive forever. This is most visible when `renderComponent` is called without an owner (e.g. from a modifier): each call creates a new renderer, so every render/destroy cycle leaked a whole renderer and the detached element. Now destroying the result (or the owner) destroys the root, and a destroyed root removes itself from its renderer, deregistering the renderer once it has no roots left. Backport of #21647 (bbac5be). On `lts-6-12` the renderer is in `renderer.ts`, and the render cache held only the `RenderResult`. The cache entry now also holds the Glimmer result, so a repeated render into the same target only destroys a result that rendered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
kategengler
pushed a commit
that referenced
this pull request
Oct 13, 2026
…he result is destroyed `RenderResult#destroy()` only destroyed the inner Glimmer render result, never the `ComponentRootState` that wraps it. The root stayed in the renderer's `roots` list, so the renderer was never deregistered from the global `renderers` list, which kept the root, its args and its `into` element alive forever. This is most visible when `renderComponent` is called without an owner (e.g. from a modifier): each call creates a new renderer, so every render/destroy cycle leaked a whole renderer and the detached element. Now destroying the result (or the owner) destroys the root, and a destroyed root removes itself from its renderer, deregistering the renderer once it has no roots left. Backport of #21647. The `release` branch does not have the `Cursor` render cache key, so `renderComponent` keeps `into` as the key. (cherry picked from commit bbac5be) Co-Authored-By: Claude Opus 5.5 <[email protected]>
NullVoxPopuli
pushed a commit
that referenced
this pull request
Oct 13, 2026
…esult is destroyed `RenderResult#destroy()` only destroyed the inner Glimmer render result, never the `ComponentRootState` that wraps it. The root stayed in the renderer's `roots` list, so the renderer was never deregistered from the global `renderers` list, which kept the root, its args and its `into` element alive forever. Now destroying the result (or the owner) destroys the root, and a destroyed root removes itself from its renderer, deregistering the renderer once it has no roots left. (cherry picked from commit 847411c, #21647) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
betocantu93
added a commit
to prysmex/ember-eui
that referenced
this pull request
Oct 14, 2026
7.3.1 releases renderComponent roots and renderers when their owner is destroyed (emberjs/ember.js#21647), which fixes the per-test memory retention found by the leak audit. It was published today, inside pnpm's minimum release age, so pnpm-workspace.yaml excludes exactly [email protected] from that check. Remove the exclusion once the release is old enough. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
I tried out claude-cloud for this.
Description from claude:
RenderResult#destroy()only destroyed the inner Glimmer render result, never theComponentRootStatethat wraps it. The root stayed in the renderer'srootslist, so the renderer was never deregistered from the globalrendererslist, which kept the root, its args and itsintoelement alive forever.This is most visible when
renderComponentis called without an owner (e.g. from a modifier): each call creates a new renderer, so every render/destroy cycle leaked a whole renderer and the detached element.Now destroying the result (or the owner) destroys the root, and a destroyed root removes itself from its renderer, deregistering the renderer once it has no roots left.
Claude-Session: https://claude.ai/code/session_01U6oM2SghwZ7bgTerTEx2hd