Pre loader

Memory problem

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


I have a big problem with memory, i try many things but it’s doesn’t effect.
It’s my code for testing memory :

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("bandTest", { theme: new SciChartJSLightTheme() });
    sciChartSurface.title = "Axis 1";
    sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { axisTitle: "Column number", axisTitleStyle: {fontSize: 12} }));
    sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { axisAlignment: EAxisAlignment.Left, axisTitleStyle: {fontSize: 12} }));

sciChartSurface.delete() have no effect for memory
I run snapshot without this code and another snapshot with this code. (snap 14 is before call SciChart and snap 15 is after call the code bellow)

What can I do?


  • You must to post comments
Best Answer

Good morning Margorie,

SciChart.js v3.2 has been released this week, which fixes a memory leak in Webassembly and improves memory management throughout.

Some content which is particularly applicable to memory use includes:

  1. Memory Best Practices documentation
  2. Memory Leak Debugging
  3. Best practice tutorial – creating a re-usable React Component with delete / proper lifecycle
  4. Our new Getting-Started page also has some best-practice for component lifecycle to delete charts on unmount.

Best regards,

  • You must to post comments
Good Answer

Hi Marjorie,

Memory is being released when you call SciChartSurface.delete() but back to WebAssembly not to the browser. Also, we are caching our graphics engine so the next Chart startup time is faster. If you instantiate a second chart and delete it memory won’t grow. It will stay the same.

You’re going to be really happy to know we’ve made a massive improvement to memory in v3.2 of SciChart.js which is in beta now.

You can try the beta from npm.

Try the code above in 3.2.0-beta but with this:


Instead of this


And you will see as soon as the chart is deleted and garbage collected by javascript memory returns to the browser. Snapshot memory should go down.

There will also be a way in v3.2 to collect all memory using SciChartSurface.create() by setting some flags to destroy the WebGL buffers and engine.

We’ll be announcing more details on memory improvements very soon.

Best regards

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.