You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Svelte 5.25.6, a simple SVG drawing app (adapted from this Joy of Code example) seems to create a memory leak.
Screenshot shows a snapshot of the heap using Chrome dev tools. Notice the instances of Circle that have accumulated, despite the canvas being cleared.
The same example works fine in Svelte 5.19.6 (not tested any other versions).
Run the example from the links below, hit "Add 2 Circles" once and "Delete Circle" twice. The canvas is clear, but inspecting the heap using Chrome shows instances of Circle class still retained.
Repeat several times and the retained instances accumulate.
Perform the same experiment on 5.19.6 and once the canvas is clear, no instances of Circle are retained.
Describe the bug
When using Svelte 5.25.6, a simple SVG drawing app (adapted from this Joy of Code example) seems to create a memory leak.
Screenshot shows a snapshot of the heap using Chrome dev tools. Notice the instances of Circle that have accumulated, despite the canvas being cleared.
The same example works fine in Svelte 5.19.6 (not tested any other versions).
Initially posted on StackOverflow.
Reproduction
Run the example from the links below, hit "Add 2 Circles" once and "Delete Circle" twice. The canvas is clear, but inspecting the heap using Chrome shows instances of Circle class still retained.
Repeat several times and the retained instances accumulate.
Perform the same experiment on 5.19.6 and once the canvas is clear, no instances of Circle are retained.
https://svelte.dev/playground/9aa0409c6b4f4e2bba5939553ab2d6d0?version=5.25.6 (memory leak)
https://svelte.dev/playground/9aa0409c6b4f4e2bba5939553ab2d6d0?version=5.19.6 (no memory leak)
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: