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

Number of GoogleChartComponent's are building up on every page with charts reload #125

Open
peterlitvak opened this issue Jul 29, 2020 · 3 comments

Comments

@peterlitvak
Copy link

I'm using version 4 of the ng2-google-charts and noticed that on every page reload the number of the GoogleChartComponent' s is growing proportionally to the number of charts on the page.
In the memory profiler it shows the the retainer is _this in system
Is there a special way I need to cleanup the components?
I've seen an issue where people were asking about cleanly destroying the component but I didn't see actual suggestion to do so.

@gmazzamuto
Copy link
Owner

I'm not sure I fully understand your problem. Are you refreshing the page like in a normal browser refresh? Or are you dynamically redrawing your page? That the number of GoogleChartComponent is equal to the number of charts in the page is expected.

@peterlitvak
Copy link
Author

There are routes that load our dashboard components.
The dashboard component contains multiple google-chart components in it.
When one dashboard is loaded and another is destroyed the GoogleChartComponent's from a previous dashboard are still held in memory.

gmazzamuto added a commit that referenced this issue Aug 1, 2020
@gmazzamuto
Copy link
Owner

Unfortunately this is not an easy thing to investigate, and I suspect that the cause of this is mostly to be attributed to the underlying Google Charts library rather than to this package. There are many reports of memory leaks indeed, which apparently are even made worse by using a dashboard:

However I have made these changes that do seem to have some minor effect on your problem. Can you please try them out? (see above). Also, I suggest that you update to the latest version of this package, which in turn uses a more recent version of Google Charts (breaking changes should be minimal).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants