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

Memory leak in realtime chart #131

Closed
harconst opened this issue Sep 25, 2018 · 2 comments
Closed

Memory leak in realtime chart #131

harconst opened this issue Sep 25, 2018 · 2 comments
Labels
bug Something isn't working high-priority

Comments

@harconst
Copy link

Codepen

Using chrome, open the task manager and inspect the browser tab containing a realtime chart like this codepen . You will notice that the memory footprint for the tab goes up by the second (sometimes 3MB/sec). Can also be seen in the realtime demo page.

Explanation

  • What is the behavior you expect?

I expected the memory footprint to be almost constant

  • What is happening instead?

The memory footprint goes up much faster than expected.

  • What error message are you getting?

No error messages

I haven't dove into the source yet, just thought to post my finding here first in case someone has spotted the same issue.

Regards

@junedchhipa
Copy link
Contributor

junedchhipa commented Sep 26, 2018

@harconst
Thanks for catching that. I tested the real-time charts and indeed the memory consumption goes much higher after 5 mins.

I am keeping an eye on this issue marking it as a high priority bug.

@junedchhipa junedchhipa added bug Something isn't working high-priority labels Sep 26, 2018
@junedchhipa
Copy link
Contributor

junedchhipa commented Oct 1, 2018

Fixed the memory leak issues in the major release v2.0.0
There were DOM elements which were referenced even after destroy()
Removed all such references. Now if you watch the realtime demo example https://apexcharts.com/javascript-chart-demos/line-charts/realtime/ - the memory footprint doesn't increase crazily.

I tested with ~100 chart updates (at every 1 sec), and the Heap Snapshot increased from 21.3 MB to 21.4 MB
screen shot 2018-10-01 at 1 18 42 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high-priority
Projects
None yet
Development

No branches or pull requests

2 participants