-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Comments
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? |
@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 :) ![]() |
@brunnerh for me amount of detached nodes directly corresponds to the number of clicks I am doing ![]() ![]() ![]() ![]() |
Also can confirm that if I remove |
@brunnerh looks like the same problem is in Safari as well ![]() |
I'm not sure what has changed, if anything? Looking at the history of |
I'm noticing the same issue, except I don't really use transitions that much so I don't think it's that. But I cannot figure out for the life of me what is happening. I'm getting thousands of detached divs when navigating between different routes that never go away and accumulate over time. |
@mcullifer Without any form of reproduction, or screenshots of the memory profile, it's really hard for us to investigate. |
@trueadm Yep totally understand. Looking through all of these divs the only pattern I think I'm seeing is maybe events? Like onclicks and stuff where I tend to do |
@mcullifer It looks like |
@trueadm Uh I can try. Currently I'm using DaisyUI so a ton of my css classes have animations of some sort. UPDATE: This is what the perf monitor looks like just doing ⬅ ➡ browser navigation over and over. |
Wondering though why it's happening in both Chrome and Safari.
Yeah, that's the same problem I am seeing when doing snapshots in my project - entire subtrees being retained by CSSAnimation. Though we are not using any external libraries or tailwind, just plain style tags. ![]() |
I've experimented a bit and discovered that the issue here is indeed
Which drives me to conclusion that |
@gyzerok Interesting, did you only find this to be the case with svelte/packages/svelte/src/transition/index.js Lines 62 to 70 in b0c4fa5
and nothing seems obvious from it's code. The only thing is the +getComputedStyle , I've never seen the + syntax so not sure what that is?
EDIT: I guess it's the Unary + Operator |
@mcullifer this (and other) function is just generating styles for each transition step. The real code that runs transitions is located in |
Describe the bug
When using transitions something isn't cleaned up properly resulting in detached nodes memory leak.
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
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: