Closed
Description
Describe the bug
Transitions in Svelte 5 causes memory leaks by holding onto the DOM nodes indefinitely.

Also I found this PR which seems to be fixing a similar problem back in 2022 and this issue, that reports something similar for version 4.
In our case we are writing highly interactive real-time SPA, which means that user will go between screens a lot and will keep tab open for days, which gets amount of detached nodes to hundreds of thousands or maybe even millions. I can get from 1k to 20k nodes in a minute.
Reproduction
Here is the repo with the smallest example: https://github.com/gyzerok/svelte-transition-memory-leak.
Clone the repo and npm i && npm run dev
.
Steps:
- Open app in Chrome
- Record memory snapshot
- Click button twice
- Record second memory snapshot
- Compare both snapshots and filter by "detached"
Logs
No response
System Info
Chrome 127.0.6533.89
Severity
blocking all usage of svelte
Metadata
Metadata
Assignees
Labels
No labels