Questions

I have found out that calling suspendUpdate() and resumeUpdate() on a SciChartSurface object allocates memory that is never released. The allocations get bigger with more data in the chart.

I have created an empty Android project. I have added a SciChartSurface and a Button. Pressing the button suspends and resumes updates. You can then see in the Android Monitor that after each press of the button the memory consumption of the app increases. Since the chart is empty the allocations are very small but still noticeable. I have attached the zip of the example project.

I believe this happens because of incorrect using of UpdateSuspender API. To prevent memory leaking you need to call dispose() or close() method on suspender instance:

val suspender = chartSurface.suspendUpdates()
suspender.dispose()

Also UpdateSuspender implements AutoClosable interface which allows you to use try-with-resources statement and ensures that suspender will be disposed and there will be no memory leaks. Also you can use helper method provided by UpdateSuspender class which we use in our examples ( it uses try-with-resources under the hood ):

UpdateSuspender.using(surface, {
// do something while surface is suspended
})