Pre loader

Memory Leak in Gantt Charts application

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

0
0

Hi, I’m facing a memory rising problem while using Gantt charts in my WPF program.

Issue Details:
In my WPF program, I would like to update Gantt charts by updating RenderableSeries in ViewModel.
I found the memory was rising after updating RenderableSeries and would never come down.

Represent:
In order to make this problem clearly, I have tried to represent it based on the Scichart GanttChart sample in SciChart WPF v8 Examples.
I did some changes to let it possible to update the Gantt Chart on the Gantt Chart View.
1. Add a button to clear and create Gantt Charts on the UI.
enter image description here
2. Add a function to generate random items
3. To update RenderableSeries according to the items generated in step 2.

Then I did test to clear and create Gantt charts continuously, and watched it by .Net memory profile.
The memory is increased from 220MB to 493MB after 200 cycles of creating and clearing, and would not come down.

I supposed that I did not release RenderableSeries correctly.
So I tried to release the DataSeries in RenderableSeries by the following steps.

RenderableSeries.ForEachDo(x =>
{
   x.DataSeries.Clear();
   x.DataSeries = null;
});
RenderableSeries.Clear();

But it didn’t work ,the memory still kept rising.

Can someone help to solve this issue?
I updated the whole project.
You could compile to run the project and click the button on the top left of the window to represent this issue, and check the memory usage in windows task manager.
enter image description here
Thanks a lot!

Version
8.6.0.28199
Images
  • You must to post comments
0
0

Hi Joeri
Thanks for your investigation and reply.
I did some tests as your suggestion.

1).To comment out the parts of VerticalSliceModifier, and add ‘VerticalLineAnnotation’ in the section of ‘SciChartSurface.Annotations’.
2).To comment out the resource of ‘DropShadowEffect’, and all its references.

Then seems it worked! The memory wouldn’t increase continuously.

Thanks for the hard work of the development team.
Waiting for the hotfix.

Best Regards,
Bruce

  • Lex
    Hi Bruce, Thank you for the update! We’re glad we helped! If you need any further assistance, please feel free to contact us. Kind regards, Lex, SciChart Technical Support Engineer
  • You must to post comments
0
0

Hi Bruce,

Thank you for reporting this.
I managed to reproduce the described behavior on our side.

I’m forwarding this to our developers for further investigation, and we’ll get back to you as soon as we have an update.

Kind regards,
Lex,
SciChart Technical Support Engineer

  • You must to post comments
0
0

Hi Lex,
Could you please edit or delete the attachment I have uploaded, I forgot to remove the runtime license.
Thanks.

  • Lex
    Hi Bruce, Done
  • bruce Y
    Hi Lex, Thanks!
  • You must to post comments
0
0

Dear Bruce,

Thank you for your patience. We prioritized this issue immediately after your report, but we couldn’t investigate it sooner due to the development team focusing on two major releases. However, we successfully published them last week. You can find more details here:
SciChart for Avalonia XPF
SciChart WPF v8.7

Regarding the memory leak you reported, we investigated it and identified two main causes:

1) DropShadowsEffect (WPF). It is used as a StaticResource, causing WPF to retain references to all elements using it (e.g., RenderableSeries and RolloverMarkers)

2) VerticalSliceModifier (SciChart). There is a bug that causes RenderableSeries to be cached internally and never released. If your use case requires frequent creation and deletion of RenderableSeries, we recommend avoiding VerticalSliceModifier until the fix is released.
As an alternative temporary solution, you can use stand-alone VerticalLineAnnotation as a replacement of VerticalSliceModifier.

Please try removing both DropShadowEffect and VerticalSliceModifier from your application and let me know if the issue persists. We are actively working on a patch, and a hotfix build will be available soon. We will notify you when the fix is released.

Best Regards,
Joeri

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.