-
Notifications
You must be signed in to change notification settings - Fork 26k
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
Animations: elements with leave transitions never cleanup causing memory leaks #25744
Comments
@alexhobbs we are running into the same issue. What did you do to fix it in the mean time? Pure css animations? |
@babeal - yes where possible we’ve had to replace with CSS or disable the animation entirely. |
Hi, we are having issues with angular material because of this bug. Specifically MatFormField inside MatDialog. |
@matsko have you got any ideas on how to approach fixing this one? I'm willing to do the work if there is a direction to take. At worst opening up some way to call a clean up on TransitionAnimationEngine.statesByElement. |
…ition In the `TransitionAnimationEngine` we keep track of the existing elements with animations and we clear the cached data when they're removed. We also have some logic where we transition away the child elements when a parent is removed, however in that case we never cleared the cached element data which resulted in a memory leak. The leak is particularly visible in Material where whenever there's an animated overlay with a component inside of it that has an animation, the child component would always be retained in memory. Fixes angular#25744.
…ition In the TransitionAnimationEngine we keep track of the existing elements with animations and we clear the cached data when they're removed. We also have some logic where we transition away the child elements when a parent is removed, however in that case we never cleared the cached element data which resulted in a memory leak. The leak is particularly visible in Material where whenever there's an animated overlay with a component inside of it that has an animation, the child component would always be retained in memory. Fixes angular#25744.
…ition (#34409) In the TransitionAnimationEngine we keep track of the existing elements with animations and we clear the cached data when they're removed. We also have some logic where we transition away the child elements when a parent is removed, however in that case we never cleared the cached element data which resulted in a memory leak. The leak is particularly visible in Material where whenever there's an animated overlay with a component inside of it that has an animation, the child component would always be retained in memory. Fixes #25744. PR Close #34409
this problem still persists in safari 13.0.4 |
@denisyilmaz using |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
When a component has a :leave transition the DOM Element reference is never removed from TransitionAnimationEngine.statesByElement map causing detached DOM nodes and out-of-memory crashes.
Debugging seems to show that the "hasAnimation" flag is preventing cleanup functions being run (see _flushAnimations). Elements never re-enter this function and therefore
removeNodesAfterAnimationDone
orprocessLeaveNode
are not triggered.Expected behavior
TransitionAnimationEngine should successfully clean up elements that have left the page.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Currently this memory leak is causing performance issues and crashes on dashboard monitor type applications which run for a long time with no user input. Over the cause of a day
statesByElement
has grown from 0 elements to 10,000.Environment
The text was updated successfully, but these errors were encountered: