Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
There are detached elements in memory snapshot after clicking the menu or autocomplete to show the dropdowns. It can be replicated in https://material.angular.io web site.
Reproduction
Steps to reproduce:
- Go to https://material.angular.io/components/menu/overview menu component page.
- Click a menu to show the drop down. Then click the API tab to destroy the menu component. Repeat this steps several times.
- Go to landing page. The menu-related memory should've been destroyed.
- Take a memory snapshot.
Do similar steps to reproduce memory leak for Autocomplete.
Expected Behavior
There should be no memory allocation related to MatMenu or MatAutocomplete because the landing page doesn't have them.
Actual Behavior
There are many detached elemets that should've been garbage collected.
Environment
- Angular: 18
- CDK/Material: 18
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Linux 6.8.0-40-generic mdProgressBar #40~22.04.3-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 30 17:30:19 UTC 2 x86_64 x86_64 x86_64 GNU/Linux