Memory leak when refresh the chart

Hi, again.
I already post message in this topic viewtopic.php?f=8&t=28527
But i can’t solve problem with memory leak when i refresh my chart.

i use very simple code from dhtmlx samples 05lines->05series

html page code

[code]

[/code]

but memory leak in function refreshchart, what i can did wrong ???
i see than memory leak in google chrome browser timeline and in the process explorer the process of browser eat more and more memory in time, but loaded data size not changed, i only load same data file in json format each 30sec.

Please can someone help and say what’s wrong with my code for refresh chart’s …
i don’t want refresh all page , i want refresh only container with chart

maybe error in the chart1.load("/data/test.json","json") function and i must use chart1.parse(companies, "json") function ??? but how i can reread file with companies if companies data can changes in time ???

anyone can help me ?

?

Alexandra, Darya? … can you help ?

Hello,

in what browser did you catch memory leaks ? Was it IE ?

In all of them, i try in the IE,FireFox and Google Chrome and in all browsers memory leak.
In the Google Chrome web developer timeline utilites show’s that memory leak.

but i use code from sample by 95%, i only add refresh each 30sec

i also try use function chart1.parse(companies, “json”) instead chart1.load("/data/test.json",“json”) but memory leak in all browsers again.
maybe function chart1.clearAll() clear not all parametres ?

We did not catch memory leaks in Chrome. In our tests we reload the chart each 5 seconds. When we checked the results in Chrome Timeline, we saw that used memory released in several seconds.

Memory leaks in IE may take place as IE garbage collector doesn’t affect ActiveX that is used for loading data.

Please can you give me sample of your code where you refresh each 5 sec ??
I use code which i post in first page and timeline show that memory leak …
maybe problem in my function ??

function refreshchart() { try{ clearTimeout(myRef); } catch(err) {} myRef = setTimeout(refreshchart,30000); chart1.clearAll(); chart1.load("/data/test.json","json"); }

And can you say how clean IE garbage collector ?

I’ve attached the sample

And can you how clean IE garbage collector ?

Garbage Collector can’t be controlled from JS code. Therefore, memory will be completely released when the page reloaded.
chart.zip (84 KB)

i open your code in chrome, but i have same problem …
when i open chrome process explorer i see that proceess memory was more and more each 5 sec by 36kb …
Are you shure that you have not memory leak in chrome ? :frowning:

Are you shure that you have not memory leak in chrome ? :frowning:

Yes, we are.

maybe option “save cash” is disabled on your browser ? …
i can’t understand why your code in my pc working with error and memory is leak …

maybe you have specific apache configuration ??

Alexandra can you help me to understand why i have memory leak ???

what i did

i add from your attachment html page and json file on the my apache server
i don’t did any changes in your code

i open this html page from chrome browser ver23.0.1271.64 and if i use windows task manager or chrom task manager i see that using memory is grow , for 40 minutes using memory increase to 20mb
in the IE ver. 8.0 memory is grow too

i open this page from another computer but nothing has changed - memory is grow

i can’t understand why in your computer you not see this …

in my dhtmlxchart.js there is a line that use dhtmlx.version=3.0

maybe problem in old version ?
and in the chrome lines between dots on graph don’t shows - shows only dots

update dhtmlxchart to ver. 3.5 but nothing has changed …

In our tests (chrome task manager) page memory usage increased by several MB within over 3-5 minutes. Then part of the memory was released (probably garbage collector run) - and memory usage became the same size as it was initially.

We have made a modification in chart that detaches legend container. So, please try attached libraries - possibly it will help.
libs.zip (67.8 KB)

Alexandra thank you for your help !!!
It’s looks like that now in google chrome memory is not leak

but in IE 8.0 memory steel leaking, and when i refresh all page by press f5 memory don’t free …
maybe you know why ???

and can you say why in chrome don’t show;s lines between dot;s on graph ?

Alexandra ???

in IE 8 memory steel leaking … can you help me solve this ploblem …
i refresh all page by pressing F5 but memory don’t free … just on the contrary, it grows

it’s look like a bug in the dhtmlxchart library

Hello,

but in IE 8.0 memory steel leaking

in one of my previous posts I wrote: “Memory leaks in IE may take place as IE garbage collector doesn’t affect ActiveX that is used for loading data.” This issue can not be solved by chart.

You may try to replace load() method with parse() - the memory usage doesn’t grow.

and can you say why in chrome don’t show;s lines between dot;s on graph ?

What lines did you mean? Could you attach a demo.

i already try use parse instead load , but it have same result - memory grow …
i use your samle that you attached in that topic and your library
demo with dot’s in attachment