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

memory leak: detached nodes are kept when using transitions #15203

Open
gyzerok opened this issue Feb 4, 2025 · 8 comments
Open

memory leak: detached nodes are kept when using transitions #15203

gyzerok opened this issue Feb 4, 2025 · 8 comments

Comments

@gyzerok
Copy link

gyzerok commented Feb 4, 2025

Describe the bug

When using transitions something isn't cleaned up properly resulting in detached nodes memory leak.

Image

This was already fixed once in #12719, so seems to be a regression due to some changes. I am wondering if it's even possible to have a test or something for it to prevent future regressions.

Reproduction

REPL

  1. Take snapshot
  2. Click button multiple times
  3. Take snapshot again
  4. Repeat and observe h1 leaking

Logs

System Info

Chrome 132.0.6834.160 (Official Build) (arm64)
Svelte 5.19.7

Severity

annoyance

@brunnerh
Copy link
Member

brunnerh commented Feb 4, 2025

This does not reproduce for me, at most singular elements are detached and nothing changes in regards to elements in subsequent snapshots.

Do you have some extension that maybe is messing with the DOM?
(E.g. those relating to translations can do that.)

@gyzerok
Copy link
Author

gyzerok commented Feb 4, 2025

@brunnerh not using chrome as my daily driver, so it's just a clean installation without any extensions. Are you sure you are taking snapshot of the right VM instance inside devtools? For me it's a common mistake to forget to record the correct one when doing it inside playground :)

Image

@brunnerh
Copy link
Member

brunnerh commented Feb 4, 2025

Yes, I remembered that pitfall and made sure to avoid it (this time).

Image

Image

@gyzerok
Copy link
Author

gyzerok commented Feb 4, 2025

I also see retainer to be connected to animation

Image

@gyzerok
Copy link
Author

gyzerok commented Feb 4, 2025

@brunnerh for me amount of detached nodes directly corresponds to the number of clicks I am doing

Image Image Image Image

@gyzerok
Copy link
Author

gyzerok commented Feb 4, 2025

Also can confirm that if I remove in:fade transition than nothing leaks for me

@brunnerh
Copy link
Member

brunnerh commented Feb 4, 2025

So, given that you said that it could not be extensions, I thought "surely it's not the browser, right?" because mine was a bit out of date. Updated it and checked again...

Old Version: 131.0.6778.265
New Version: 132.0.6834.160

Image

Thanks, Chrome 👍

@gyzerok
Copy link
Author

gyzerok commented Feb 4, 2025

@brunnerh looks like the same problem is in Safari as well

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants