-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(Tree): Memory leak when changing data source #30322
Labels
area: cdk/tree
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Comments
naaajii
added a commit
to naaajii/components
that referenced
this issue
Feb 1, 2025
fixes component retaining old data in memory even when its not used causing memory usage to increase fixes angular#30322
naaajii
added a commit
to naaajii/components
that referenced
this issue
Feb 26, 2025
fixes component retaining old data in memory even when its not used causing memory usage to increase fixes angular#30322
naaajii
added a commit
to naaajii/components
that referenced
this issue
Feb 26, 2025
fixes component retaining old data in memory even when its not used causing memory usage to increase fixes angular#30322
mmalerba
pushed a commit
that referenced
this issue
Mar 19, 2025
fixes component retaining old data in memory even when its not used causing memory usage to increase fixes #30322
mmalerba
pushed a commit
that referenced
this issue
Mar 19, 2025
mistrykaran91
pushed a commit
to mistrykaran91/components
that referenced
this issue
Mar 20, 2025
fixes component retaining old data in memory even when its not used causing memory usage to increase fixes angular#30322
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: cdk/tree
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
17.2.2
Description
After upgrading Angular project from v17 to v18, our team noticed a memory leak in the app. After profiling, I found that
mat-tree
component holds references to old node objects after updating the data source, which prevents them from being collected by GC.Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-ujvrwarq?file=src%2Fmain.ts
Steps to reproduce:
Expected Behavior
Old
Node
objects must be collected by GC. The memory heap should contain only those objects that are present in the tree.Actual Behavior
Node
objects are never collected by GC. The size of the memory heap groves over time as node objects accumulate in memory.Environment
The text was updated successfully, but these errors were encountered: