Hello,
I found an issue with very high memory usage by the application. after some tests I found the problem and moved it to a separate example(https://codepen.io/PodaRocheK/pen/PoVmzvP?editors=0011). Please check this code and observe the memory usage on this page. With prolonged use (after 10 minutes), it is clear that more and more memory is used. After hours, the memory used may already be more than several gigabytes. Tell me what the problem is, maybe I’m doing something wrong. Maybe I’m somehow storing old data incorrectly or adding it incorrectly.
This example is not a working example, it has been sped up in order to quickly identify the problem. In our example, an unnecessary data update will occur once every few seconds and after a night of inactivity, the entire page will die. Please tell me what the problem is.
Thank you!
- You must login to post comments
Hi
The issue here is that the new DataSeries that is being passed to the animation is never deleted. The problem is that we can’t just auto-delete that series when the animation completes, because it might be used elsewhere. In fact the correct way to do this is to use a single series instance for passing animation values, using clear and appendRange. Here is an updated pen showing this method, which no longer crashes. https://codepen.io/scichart/pen/KKJmxRo
I’m going to update our demo and documentation to show the correct method, and I have also created a task for us to look at possible ways to improve this in the future, either by warning if it looks like you are creating endless DataSeries, or by giving an alternative way to provide the updated data.
Regards
David
- David Burleigh answered 3 weeks ago
- You must login to post comments
Interesting … thanks for the code reproduction, that’s really helpful
You’re making use of animations in the updateData
function here right?
updateData(setID, statsAI) {
if(this.dataSeries.count() !== setID) {
this.dataSeries.clear();
this.dataSeries.appendRange(statsAI.changeAI, statsAI.activityAI)
} else {
this.scatterSeries.runAnimation(new ScatterAnimation({
duration: 10,
ease: easing.outQuad,
dataSeries: new XyDataSeries(this.wasmContext, {
xValues: statsAI.changeAI,
yValues: statsAI.activityAI
})
}));
}
}
My gut feeling (although requires investigation) is this ScatterAnimation
with a from-to dataSeries has a memory leak that needs to be fixed on our side.
Give us a day to look at this and we will get back to you,
Best regards,
Andrew
- Andrew Burnett-Thompson answered 3 weeks ago
- The example I sent does not use animation (it is commented out). This problem occurs both without animation and with animation. Can you check both options?
- There was a fix related to memory leaks for scatter and bubble series in a recent version. I can’t see a leak with the latest version 3.2.509, but I do see an eventual crash when the animation code is enabled, which we will investigate.
- You must login to post comments
Please login first to submit.