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

igx-data-chart memory leak when there are two or more charts with the same sync channel #13995

Open
jsakamotoIGJP opened this issue Mar 18, 2024 · 8 comments
Labels
🐛 bug Any issue that describes a bug 🆕 status: new

Comments

@jsakamotoIGJP
Copy link

When two or more igx-data-chart components on a page are combined with the same sync channel, a memory leak occurs after leaving that page.

Steps to reproduce

  1. Open the browser's Dev Tools / Memory tab.
  2. Take the 1st memory snapshot (don't forget to click the "Collect garbage" button before taking.)
  3. Just navigate to the page with two igx-data-chart components combined with the same sync channel.
  4. Go back to the home page.
  5. Take the 2nd memory snapshot (remember to click the "Collect garbage" button before taking it).
  6. In the Dev Tools Memory tab, Choose "Comparison" in the "Perspective" dropdown and input "igx" into the "Class filter" text field.
2024-03-18_17h07_36.mp4

Result

You will see there are some objects with the name "igx" that were added but not deleted in the "Comparison" view of the Memory tab.

Expected result

The "Delta" column for all objects with the name "igx" should be zero in the "Comparison" view of the Memory tab.

Attachments

📦c-00235192-ng-app1-v17.1.4 (3).zip

@gmurray81
Copy link
Member

Please note we don’t technically consider this to be a bug. It is intended that the syncchannel keeps a chart pinned and prevents it from being collected. There are expensive resources associated with the synclink if you are simply detaching the chart from the layout and moving it elsewhere that we don’t wish to churn.
However, for Angular, since we do receive an unambiguous signal that a component is being destroyed, we will unhook the chart from the syncchannel when angular sends this signal, as a resolution.
But it is intended generally that a user remove a chart from a synchannel when it is being discarded. On other platforms we do not receive unambiguous signals that you are finished with the component.

Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label May 18, 2024
@jsakamotoIGJP
Copy link
Author

@gmurray81 I strongly agree that it is not technically a bug. On the other hand, is there a workaround for this issue, such as an explicit way to release resources? Or is it okay to request a workaround, such as creating a workaround entry point? Or, according to your reply, can I expect that this issue is technically solvable in Angular at least, and that the fixed version of "Ignite UI for Angular" will be released someday?

Because regardless of how this issue is from a technical standpoint, we need to be able to provide some solutions or workarounds to a support request from a customer who is having trouble with memory leaks.

Your feedback is greatly appreciated as we work together to find a solution to this issue.

@gmurray81
Copy link
Member

@jsakamotoIGJP sorry, I was trying to explain that above. It should be fine as long as you remove it from the syncChannel, set that to null and it should unpin the resource. Anyhow, as I said we might make angular in particular clean up since it gets an explicit destory message. But we weren't prioritizing it given you can explicitly release by nulling the syncChannel.

@jsakamotoIGJP
Copy link
Author

@gmurray81 Thank you for your so prompt response!
Oh, sorry for my lack of reading skills. Okay, I believe I understand now. I'll respond to our customers to explain this method of explicitly removing charts from syncChannel. I'll let you know the result of our communication with our customers later.
Thanks!

@github-actions github-actions bot removed the status: inactive Used to stale issues and pull requests label May 21, 2024
Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Jul 20, 2024
@gmurray81 gmurray81 removed the status: inactive Used to stale issues and pull requests label Jul 20, 2024
Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Sep 19, 2024
@gmurray81 gmurray81 removed the status: inactive Used to stale issues and pull requests label Sep 19, 2024
Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Nov 19, 2024
@gmurray81 gmurray81 removed the status: inactive Used to stale issues and pull requests label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Any issue that describes a bug 🆕 status: new
Projects
None yet
Development

No branches or pull requests

2 participants