Skip to content
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

Dialog causes memory leak when dialog component contains a <button> #10188

Closed
benelliott opened this issue Feb 28, 2018 · 6 comments
Closed

Dialog causes memory leak when dialog component contains a <button> #10188

benelliott opened this issue Feb 28, 2018 · 6 comments
Assignees
Labels
animation This issue is related to Angular animations or CSS animations P2 The issue is important to a large percentage of users, with a workaround perf This issue is related to performance

Comments

@benelliott
Copy link
Contributor

benelliott commented Feb 28, 2018

Bug, feature request, or proposal:

Instantiating a dialog with a component that contains a regular HTML <button> element causes a DOM node memory leak.

What is the expected behavior?

No memory leak

What is the current behavior?

Memory leak

What are the steps to reproduce?

https://stackblitz.com/edit/angular-material2-issue-dhmjle?file=app/app.module.ts

  1. Open Chrome performance monitor
  2. Click Memory > Garbage collect
  3. Note the initial DOM node count (around 53)
  4. Click the "No leaks on div" button a few times and watch the DOM node count climb
  5. Close any open dialogs and press the "Garbage collect" button again
  6. Watch the DOM node count decrease to around the initial value (plus some "sticky" dialog nodes that intentionally stick around)
  7. Click the "Leaks on button" button a few times and watch the DOM node count climb
  8. Close any open dialogs and press the "Garbage collect" button
  9. Note that the DOM node count does not decrease to the initial value

memleak

What is the use-case or motivation for changing an existing behavior?

Performance

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest StackBlitz (Material 5.1.0, Angular 5.2.1), Windows 10, Chrome v64.0.3282.186 64-bit

Is there anything else we should know?

Could be related to angular/angular#20228

@StoneMorKnight
Copy link

Any movement on this?

@letrim
Copy link

letrim commented Jul 17, 2018

Exact same behavion on Angular 6

@tesseris
Copy link

tesseris commented Aug 3, 2019

The issue still persists in version 8.2.

@Splaktar Splaktar added P2 The issue is important to a large percentage of users, with a workaround perf This issue is related to performance animation This issue is related to Angular animations or CSS animations labels Dec 13, 2019
@Splaktar
Copy link
Member

This is likely also caused by angular/angular#25744.

@crisbeto
Copy link
Member

Should be fixed in core by angular/angular#34409.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
animation This issue is related to Angular animations or CSS animations P2 The issue is important to a large percentage of users, with a workaround perf This issue is related to performance
Projects
None yet
Development

No branches or pull requests

6 participants