-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
area: animationsfreq3: highhotlist: googleregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:
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
or processLeaveNode
are not triggered.
Expected behavior
TransitionAnimationEngine should successfully clean up elements that have left the page.
Minimal reproduction of the problem with instructions
- Create ListItemComponent which has a simple :leave transition in the @component decorator
- Include this component with an *ngIf toggle attached to a button in the main AppComponent to trigger the :leave animation
- Watch detached DOM nodes grow and TransitionAnimationEngine.statesByElement grow
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
Angular version: 6.1.4
Browser:
- [x] Chrome (desktop) version 68
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
r-havelka, jleufven, Jonafran, benelliott, andrei-ilyukovich and 12 more
Metadata
Metadata
Assignees
Labels
area: animationsfreq3: highhotlist: googleregressionIndicates than the issue relates to something that worked in a previous versionIndicates than the issue relates to something that worked in a previous versionstate: has PRtype: bug/fix