c3js / c3js/c3

Memory Leak when load() API is called even with option "unload: true"

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

Description

* **C3 version**: 0.7.20
* **D3 version**: 5.16.0
* **Browser**: Chrome/Firefox official version
* **OS**: Windows 10, Linux, macOS

Same issue as [#1961](https://github.com/c3js/c3/issues/1961), I create 7 line-charts with timeseries x-axis, and each chart has 240 data points.
Only on page load, it uses c3.generate() to create charts, and then each chart uses c3.load() with unload option set as “true” (means unload all data mentioned in the c3 reference document) to update its 240 data points per 5 minutes.
I can observe the memory usage will increase 30MB~100MB per update in whole page by checking chrome task monitor.
It is easy to reproduce by using setTimeout() function or create a button to manually trigger.

By the way, the other case I found if the c3.chart is rendered complete, when blur the page to other window or app to do something about several minutes, and then back to the page with the c3.chart, the page will freeze a period of time. The cpu/memory usage grow up very fast until the the page recoveries.

PS. The page is the visible tab.

Is there any idea for this issue ?

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.