-
Notifications
You must be signed in to change notification settings - Fork 162
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
igx-select memory leak #13923
Comments
@pmoleri Please remember that kind of memory leak issues may happen not only in the "igx-select" but also in "igx-grid," "igx-chip," "igx-data-chart," etc. |
@pmoleri, @jsakamoto this is the fix that will remove the memory leak: https://github.com/IgniteUI/igniteui-angular/pull/13926/files#diff-2b12c6b9ff35bdd97b9a62948ada434845879e91b45cdc33415f98260a2ffa9bL554. @pmoleri thank you for all the suggestions! We will apply the one above and in a separate PR will make the selection service imported on a component level instead of on a root level, which will also remove the need to delete the empty sets that are currently left on each selection. |
Hi @Lipata, thank you for your quick response! By the way, I have a question regarding the memory leak issue that was brought up on the Discord server (see also here). Will the other components mentioned by the user, such as igx-grid and igx-chip, be fixed soon? Or should I log them as separate issues? Thank you for your help! |
@pmoleri in addition to my previous comment - we removed the select memory leak and also now the selection service is deleting the set when the selection is empty instead of setting it as an empty set. Providing the selection service on a component level instead of on a root, will not happen, as per #13938 (comment):
|
@Lipata Could you please address another memory-leaking issue as below?
Thanks in advance. |
Description
igx-select leaks itself and can make leak other components such as Grid.
related: #11672
Steps to reproduce (Chrome)
Add a igx-select (see attached stackblitz)
set it up with an ngIf so it can be destroyed and re-created as many times as you want
open the select
destroy without closing the dropdown
re-create it and repeat
Open Dev Tools / Memory tab (Chrome)
Take a memory snapshot (if there's more than one process it's important to pick the correct one)
Search for IgxSelectItemComponent (or "Detached HTMLElement" if you're using production build).
-> Here you can confirm that there are many leaked elements
Search for IgxSelectionAPIService, select the instance and hover it to inspect its contents
-> There are entries holding those elements:
Right click to store it as a global var (temp1 in this example)
In the console run
temp1.selection.clear()
Grab a new snapshot and search again
-> Now only the Service and Module are there.
Result
There are memory leaks as verified in the steps
Expected result
No memory leaks
Attachments
Stackbliz: https://stackblitz.com/edit/hr9mt8?file=src%2Fapp%2Fselect-sample-1%2Fselect-sample-1.component.html,src%2Fapp%2Fselect-sample-1%2Fselect-sample-1.component.ts
The text was updated successfully, but these errors were encountered: