c3js / c3js/c3

Memory Leak when load() API is called

Open
#1,961 7 comments 6 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

I haven't had a chance to look into the code of the load() API, but I`m pretty sure there is a memory leak in somewhere. I created an application on Electron and I`m using c3.js to draw sparkline charts. I called the load() API inside a timer and the application consumes more than 100 MB of RAM without any reasonable reason. If I comment out the load() API then the memory consumption is around 30 MB.

var remove = false;
if(cpuSparkData[0].length>10){
var remove = true;
}

for(var i = 0; i < data.cpus.length ; i++){
var load = parseFloat(data.cpus[i].load).toFixed(0);
console.log(cpuSparkData.length);
cpuSparkData[i].push(load);
if(remove){
cpuSparkData[i].splice(1,1);
}
}


/*cpuSparkChart.load({

columns: cpuSparkData});

});*/

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.