Hi,
We have been noticing some of our apps using an excessive amount of memory. This seems to occur when we use live ticking charts. We also noticed in some instances when we have tooltips, if we keep moving the most over points memory in chrome would also go up drastically.
I cannot post to JSFiddle from this pc so please see the below,
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
window.onload = function () {
tick = true;
var dps = [{x: 1, y: 10}, {x: 2, y: 13}, {x: 3, y: 18}, {x: 4, y: 20}, {x: 5, y: 17},{x: 6, y: 10}, {x: 7, y: 13}, {x: 8, y: 18}, {x: 9, y: 20}, {x: 10, y: 17}];
var chart = new CanvasJS.Chart("chartContainer", {
data: [{
type: "line",
dataPoints : dps
}]
});
chart.render();
updateInterval = 1000;
var updateChart = function () {
if (!tick) return;
// leak occurs whether or not data changes
//dps[dps.length - 1].y = Math.round(5 + Math.random() *(-5-5));
chart.render();
}
setInterval(function(){ updateChart() }, updateInterval);
}
</script>
<script type="text/javascript" src="/js/canvasjs-commercial-1.8.0/canvasjs.min.js"></script>
</head>
<body>
<div id="chartContainer" style="height: 300px; width: 100%;">
</div>
</body>
</html>
-
This topic was modified 8 years, 8 months ago by gtsafas.