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.

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.

Thanks a lot!
- bruce Y asked 1 year ago
- last edited 1 year ago
- You must login to post comments
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
- Joeri R answered 1 year ago
- You must login to post comments
Hi Bruce,
Concerning the memory leak that you see with SciChart v8.8, it must be caused by a StaticResource that is used inside the RolloverMarkerTemplate in “GanttChartResources.xaml.” This is a known WPF issue and does not originate within SciChart – it must be avoided on the application side.
To resolve it, please try removing the DropShadowEffect StaticResource from the RolloverMarkerTemplate inside the ItemRenderableSeriesStyle defined in “GanttChartResources.xaml.” After making this change, the memory leak should be entirely eliminated.
Please let me know if this helps or if you need any further assistance,
Best Regards,
Joeri
- Joeri R answered 12 months ago
- You must login to post comments
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
- Lex answered 1 year ago
- You must login to post comments
Hi Lex,
Could you please edit or delete the attachment I have uploaded, I forgot to remove the runtime license.
Thanks.
- bruce Y answered 1 year ago
- last edited 1 year ago
Hi Bruce, Done
Hi Lex, Thanks!
- You must login to post comments
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
- bruce Y answered 1 year ago
- last edited 1 year ago
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 login to post comments
Hi Bruce,
Thanks again for reporting this issue.
I’m glad to inform you that we have published an updated SciChart version containing the fix for it. The changes are included in SciChart v8.7.1.28499.
Please try it out and let us know your feedback.
Here you can find more details regarding our latest releases and how to get them:
SciChart WPF Changelog – SciChart
Kind regards,
Lex,
SciChart Technical Support Engineer
- Lex answered 1 year ago
- You must login to post comments
Thanks again for your hard work!
I will update to the latest version.
- bruce Y answered 1 year ago
- last edited 1 year ago
- You must login to post comments
Hi Lex
I updated to the latest version ‘8.7.1.28499’ and did some test.
I got an exception once I cleared the RenderableSeries.
>KeyNotFoundException: 给定关键字不在字典中。
>——————————————-
>
>Stack Trace:
> 在 System.ThrowHelper.ThrowKeyNotFoundException()
> 在 System.Collections.Generic.Dictionary2.get_Item(TKey key)2 hxg, ModifierEventArgsBase hxh)
> 在 SciChart.Charting.ChartModifiers.VerticalSliceModifier.DetachRolloverMarker(FrameworkElement rolloverMarker)
> 在 SciChart.Charting.ChartModifiers.VerticalSliceModifierBase.RemoveMarkers()
> 在 SciChart.Charting.ChartModifiers.VerticalSliceModifier.RemoveMarkers()
> 在 SciChart.Charting.ChartModifiers.VerticalSliceModifier.HandleMasterMouseEvent(Point mousePoint)
> 在 SciChart.Charting.ChartModifiers.InspectSeriesModifierBase.pxu(Point hvp)
> 在 SciChart.Charting.ChartModifiers.InspectSeriesModifierBase.HandleMouseEvent(ModifierMouseArgs e)
> 在 SciChart.Charting.ChartModifiers.InspectSeriesModifierBase.OnModifierMouseMove(ModifierMouseArgs e)
> 在 SciChart.Charting.ChartModifiers.ModifierGroup.lcb(Action
> 在 SciChart.Core.Utility.Mouse.MouseManager.lfu(ModifierMouseArgs bmi, IReceiveMouseEvents bmj, Boolean bmk)
> 在 SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable1 enumerable, Action1 operation)
> 在 SciChart.Core.Utility.Mouse.MouseManager.lfi(IReceiveMouseEvents blf, ModifierMouseArgs blg, Action3 blh)3 blc)
> 在 SciChart.Core.Utility.Mouse.MouseManager.lff(IPublishMouseEvents bky, IReceiveMouseEvents bkz, MouseEventArgs bla, MouseButtons blb, Action
> 在 SciChart.Core.Utility.Mouse.MouseManager.goy.iak(Object bnr, MouseEventArgs bns)
> 在 rro.vni(MouseEventArgs bpp)
> 在 rro.vng(Object bpl, MouseEventArgs bpm)
> 在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
> 在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
> 在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
> 在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
> 在 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
> 在 System.Windows.Input.InputManager.ProcessStagingArea()
> 在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
> 在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
> 在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
> 在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
> 在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
> 在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
> 在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
> 在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
> 在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
![]()
I tried to just leave one line to do the clear, it still could not work.
> RenderableSeries.Clear();
Did I clear ‘RenderableSeries’ in a wrong way?
Or it’s a new issue?
Please check. Thanks.
Best Regards.
Bruce
- bruce Y answered 1 year ago
- last edited 1 year ago
Hi Lex I updated to the latest version v8.8 on NuGet. The crash issue has been fixed now, but the memory leak issue reappeared. After gant-chart updated for 200 times, the memory usage grew from 248MB to 700+MB. Please check again.
Hi Bruce, Thank you for the update. I’m forwarding this to our developers. Kind regards, Lex
Hi Bruce, it must be caused by DropShadowEffect used as StaticResource inside the RolloverMarkerTemplate in “GanttChartResources.xaml.” This is a known WPF issue and does not originate within SciChart – it must be avoided on the application side. Could you please try to remove it and confirm if the leak disappears?
Hi Joeri, I did test again as your suggestion, it worked. I misunderstood that the issue of DropShadowEffect was also covered in the hotfix. And I revisited the DropShadowEffect issue, as you have said, it’s a WPF issue. Thanks for your information. Best Regards, Bruce.
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
- 2 more comments
- You must login to post comments
Please login first to submit.

