-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bug(MatMenu): Memory Leak in MatMenu and MatAutocomplete #29696
Labels
area: material/autocomplete
area: material/menu
area: material/select
needs investigation
A member of the team needs to do further investigation to determine the root cause
Comments
crisbeto
added
needs investigation
A member of the team needs to do further investigation to determine the root cause
area: material/autocomplete
area: material/menu
area: material/select
and removed
needs triage
This issue needs to be triaged by the team
labels
Sep 9, 2024
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Sep 9, 2024
The `OverlayRef` was triggering an `afterEachRender` and passing in an `EnvironmentInjector`. Under the hood this uses a `DestroyRef` that is never destroyed, because the `EnvironmentInjector` is almost never destroyed. These changes add an explicit `destroy` call to avoid the issue. Fixes angular#29696.
crisbeto
added a commit
to crisbeto/material2
that referenced
this issue
Sep 9, 2024
The `OverlayRef` was triggering an `afterEachRender` and passing in an `EnvironmentInjector`. Under the hood this uses a `DestroyRef` that is never destroyed, because the `EnvironmentInjector` is almost never destroyed. These changes add an explicit `destroy` call to avoid the issue. Fixes angular#29696.
crisbeto
added a commit
that referenced
this issue
Sep 10, 2024
The `OverlayRef` was triggering an `afterEachRender` and passing in an `EnvironmentInjector`. Under the hood this uses a `DestroyRef` that is never destroyed, because the `EnvironmentInjector` is almost never destroyed. These changes add an explicit `destroy` call to avoid the issue. Fixes #29696. (cherry picked from commit 3a62ab1)
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area: material/autocomplete
area: material/menu
area: material/select
needs investigation
A member of the team needs to do further investigation to determine the root cause
Is this a regression?
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:
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
The text was updated successfully, but these errors were encountered: