I am using chrome's memory profiler to see the heap size. Its always around 10 MB. But my task manager's memory keeps on increasing it reaches more than 1 GB if I leave my website running. Even at this time the heap size in the profiler remains less than 10 MB. However when I close the profiler the memory in the task manager reduces to around 200 MB.
Could someone please explain why the process takes so much of memory when the actual heap size is very less.
Thanks in advance.
Dev.
This is the code:
updateChartData : function(priceArr, aKey, time){
var tickData = tickDataMap[aKey+priceArr[0]];
var price = parseFloat(priceArr[4]);
if(tickData == undefined){
tickData = new Array();
tickDataMap[aKey+priceArr[0]] = tickData;
}
if(tickData.length > 200){
tickData.splice(0,(tickData.length - 200));
}
tickData.push([time,price]);
drawLiveTickChart(this, key);
}
function drawLiveTickChart(liveTickChart,key){
var biddata = tickDataMap[key+'0'];
var offerdata = tickDataMap[key+'1'];
if(chartComponent !== null && chartComponent !== undefined){
try {chartComponent.destroy();}catch(ex){alert("Error while drawing the tick chart : " +ex);}
delete chartComponent;
chartComponent = null;
}
chartComponent = new Highcharts.StockChart({
chart : {
renderTo : 'chartholder'
},
yAxis: {
opposite : false
},
xAxis: {
labels : {enabled:false}
},
plotOptions:{
series: {
animation: {
duration: 0
}
}
},
rangeSelector: {
enabled : false
},
exporting : {
enabled : false
},
navigator : {
enabled : false,
height:30
},
scrollbar:{
enabled : false
},
tooltip: {
borderColor:"black",
style: {
color: 'black'
}
},
series : [{
name : "Bid",
data: biddata,
color : '#008080'
},{
name : "Offer",
data: offerdata,
color : '#02D4D4'
}
]
});
}