I have heard from too many people that JavaScript libruaries like jqPlot or Flot that are designed to draw graphs have memory leaks if updated live for a long period of time. I know that most use the replot() function to update the graph in real time but that's where the problem seems to happen.
Has anybody figured out a work around this? Maybe refreshing the entire graph and the jquery code in a DIV?
I have heard from too many people that JavaScript libruaries like jqPlot or Flot that are designed to draw graphs have memory leaks if updated live for a long period of time. I know that most use the replot() function to update the graph in real time but that's where the problem seems to happen.
Has anybody figured out a work around this? Maybe refreshing the entire graph and the jquery code in a DIV?
Share Improve this question asked Jun 17, 2011 at 0:05 kidalexkidalex 1,5272 gold badges12 silver badges14 bronze badges2 Answers
Reset to default 6you should use the “destroy” method (plot.destroy())
on your plot before you empty the container and draw the plot again.
It worked for me!
No, i tried it with emptying the div and redraw the plete diagram with jqPlot. That doesn't help either. I did it like this:
$('#diagramContainer').empty();
targetPlot = $.jqplot('#diagramContainer',
toDraw, diagramOptions);
Doing this lots of times with many data leads also to memory leaks.