Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: address regressed memory leak #11832

Merged
merged 2 commits into from
May 29, 2024
Merged

fix: address regressed memory leak #11832

merged 2 commits into from
May 29, 2024

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented May 29, 2024

This PR essentially reverts #11752. As lovely as that PR was, it brought back the memory leak that #11197 solved. I should have noticed this when I reviewed the PR.

Essentially, the culprit is this #11752 (review). We cannot do this as it means we will retain references to DOM elements that might have been removed or changed from some other effect within. The memory leak is bad too, as we just end up retaining everything.

We can maybe come up with a nicer cleanup after this, but I want to remove this memory leak first.

If you'd like a repro case, render an each block with a few thousand elements. Then update and remove them all, notice how we retain all the each block elements in the parent effect because they're referenced in its effect.dom array.

Copy link

changeset-bot bot commented May 29, 2024

🦋 Changeset detected

Latest commit: 0789638

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@trueadm trueadm merged commit 22e2aec into main May 29, 2024
8 checks passed
@trueadm trueadm deleted the fix-another-mem-leak branch May 29, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants