SciChart.js stores memory in WebAssembly. This allows us to achieve our incredible performance, and also provide a unfied experience across SciChart platforms (Windows, iOS, Android and JavaScript).
Unlike JavaScript which has built-in garbage collection, WebAssembly requires that you delete memory that you have allocated. Think of it as similar to closing a WebSocket connection if you want to close the connection and free memory.
Examples of how to use Delete()
Once you are finished with the DataSeries, don't forget to call IDeletable.delete(). This frees WebAssembly native memory and releases it back to the host.
Below are a few examples of best-practices when deleting dataSeries, renderableSeries and sciChartSurfaces.
Failing to call IDeletable.delete() on a DataSeries or it's parent SciChartSurface when it is no longer needed can result in a memory leak.
To simplify your code, if you do not change DataSeries instances, you can call delete on the parent SciChartSurface once. This will delete all child objects that hold native memory.