-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Closed
Labels
area: animationsmemory leakIssue related to a memory leakIssue related to a memory leakstate: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
animations
Is this a regression?
No
Description
If you use an animation on the element and toggle it with ngIf, it seems to be staying in the memory according to Detached Elements debugger in Edge. On a brief look it appears that maybe a WeakMap has to be used some place instead of Map:
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/stackblitz-starters-vnp1kv
- Open this link in Edge browser
- Open DevTools -> Detached Elements tab
- Select the correct frame in the dropdown on that tab (it should say
https://stackblitz-starters-vnp1kv.stackblitz.io/) - Toggle element a few times with the button
- Press get detached element
- Press analyze to see what keeps the elements there (you will see the above screenshot)
Please provide the exception or error you saw
Multiple copies of DOM element stay in memory.
Please provide the environment you discovered this bug in (run ng version)
I noticed it in Angular 12, but it is reproducible in 16 as well, see linked StackBlitz
Anything else?
An article I learned about Detached Elements from:
https://blogs.windows.com/msedgedev/2021/12/09/debug-memory-leaks-detached-elements-tool-devtools/
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: animationsmemory leakIssue related to a memory leakIssue related to a memory leakstate: has PR
