Dialog causes a memory leak when Dialog component contains mat-form-field
See original GitHub issueWhat is the expected behavior?
Instantiating a dialog with a component that contains mat-form-field
element causes a DOM node memory leak.
What is the current behavior?
Memory leak
What are the steps to reproduce?
https://stackblitz.com/edit/angular-yx1kuw?file=app%2Fdialog-overview-example-dialog.html
Try to open and close the dialog several times. Notice each time the number of detached DOM nodes gets higher and forcing garbage collection doesn’t reduce it.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular Material: 7.3.7 Chrome: 73.0.3683.103
Is there anything else we should know?
Could be related to https://github.com/angular/material2/issues/10188
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:11 (1 by maintainers)
Top Results From Across the Web
material dialog causing memory leak - angular - Stack Overflow
Trying to solve a memory leak, I notice that each time a material dialog is opened, another detached DOM tree is added. I...
Read more >Angular Tips & Tricks part VIII
Have you created an Angular component that needs an Input defined by ... more and more memory, you are probably dealing with memory...
Read more >Angular Material 2 Input Leak - StackBlitz
An HTML input, when written to, causes a memory leak (the parent component cant be garbage collect once destroyed)
Read more >Angular Material Data Table: A Complete Example
A complete example of an Angular Material Data Table with server-side pagination, sorting, filtering, as well as a loading indicator.
Read more >multiple components match node with tagname mat-form-field
I have an Angular Material application where I have a list of cards, ... causes a memory leak when Dialog component contains mat-form-field#15823....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this could be the root cause issue: angular/angular/issues/25744
Should’ve been fixed in 9.0.0-rc.7 by https://github.com/angular/angular/commit/835ed0f35fa187f4051129ab30b7b635f15aeb57.