dojo - memory leak in a chart create/render/destroy cycle -



dojo - memory leak in a chart create/render/destroy cycle -

i have basic chart2d question. isn't chart.destroy() supposed remove , clean-up memory? if yes, why next code becomes memory hog? please note won't see chart because it's destroyed instantly. using google chrome's task manager @ memory usage, , after 20 minutes goes beyond 200mb.

i know updateseries(), that's not want, graph properties may alter in each iteration (title, axes, plots, data, colors, etc.), figured easiest way destroy chart , recreate again. , if there improve way solve problem i wondering what's best way rid of chart , memory bindings?

one side note: if remove addplot, addaxis, , addseries lines (so new, render, , destroy left), you'd still same, high memory usage. also, using 1.8.0.

thanks,

<meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="dojo/dojo.js" djconfig="isdebug: true"></script> <script type="text/javascript"> dojo.require("dojox.charting.chart2d"); runcharts = function() { settimeout(makecharts, 100); }; makecharts = function(){ var chart1 = new dojox.charting.chart2d("simplechart", {delayinms:0}); chart1.addplot("default", {type: "lines"}); chart1.addaxis("x"); chart1.addaxis("y", {vertical: true}); chart1.addseries("series 1", [1, 2, 2, 3, 4, 5, 5, 7]); chart1.render(); chart1.destroy(); settimeout(makecharts, 100); }; dojo.addonload(runcharts); </script> <div id="simplechart" style="width: 250px; height: 150px;"></div>

not sure if help, give try:

chart1.destroy(); delete chart1;

memory-leaks dojo dojox.charting

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -