You must be logged in to post your query.
Home › Forums › Chart Support › Memory leak?
Tagged: "memory leak" destroy()
Now… why not suspect CanvasJS?
I run three different pages with several charts, being updated every ten seconds, executing destroy() prior to rendering. What happens since yesterday is like destroy() is not being executed anymore: the RAM in use by Chrome grows with every chart update, till after a few hours the browser freezes into an out of memory error.
We have tested the destroy() and it seems to be working fine.
Can you kindly create a JSFiddle reproducing the issue you are facing and share it with us so that we can look into the code, understand the scenario better and help you out?
Sorry for my late response.
After going through my code and comparing it with an example for handling dynamic data on this website, I realized that I had made an insane mistake by destroying and declaring a chart for every data update. I got to this by modifying some examples while getting familiar with CanvasJS.
After rearranging my code I don’t even need destroy() anymore and the RAM used by the browser is very modest.
Glad that you were able to figure it out. You can just update the chart options/data and call chart.render for creating a dynamic chart instead of destroying and re-instantiating it.
You must be logged in to reply to this topic. Login/Register