Potential memory leak in 2014.2.1924 (WPF)
Posted: Wed Oct 08, 2014 6:12 am
Hi,
I am trying the latest prerelease build 2014.2.1924 for rendering the charts (e.g. StiLineSeries) which has improved performance for the charts.
However I noticed that if you run multiple big reports few time then you run out of memory quickly and this problem was NOT there with 2014.1 full release build.
After debugging, I noticed that after disposing off the report the memory is not released by Stimulsoft components and looks like the KeyEventHandler is still referenced.
I used red gate ANTS memory profiler to detect this and attaching the retention graph showing the same.
Using reflector I drilled down the assemblies and looks like in StiWpfViewerControl class in the ControlLoaded method you guys register for KeyEventHandler and but no when is un-registering it, which is causing this problem and the chain in retention graph is not breaking and hence GC is not able to claim memory.
Could you please look into this problem and advice?
Providing a sample project showing problem will be time consuming for me.
Thanks,
Sandeep
I am trying the latest prerelease build 2014.2.1924 for rendering the charts (e.g. StiLineSeries) which has improved performance for the charts.
However I noticed that if you run multiple big reports few time then you run out of memory quickly and this problem was NOT there with 2014.1 full release build.
After debugging, I noticed that after disposing off the report the memory is not released by Stimulsoft components and looks like the KeyEventHandler is still referenced.
I used red gate ANTS memory profiler to detect this and attaching the retention graph showing the same.
Using reflector I drilled down the assemblies and looks like in StiWpfViewerControl class in the ControlLoaded method you guys register for KeyEventHandler and but no when is un-registering it, which is causing this problem and the chain in retention graph is not breaking and hence GC is not able to claim memory.
Code: Select all
//The StiWpfViewerControl class
void IComponentConnector.Connect(int connectionId, object target)
{
switch (connectionId)
{
case 1:
this.viewerControl = (StiWpfViewerControl)target;
this.viewerControl.SizeChanged += new SizeChangedEventHandler(this.UserControl_SizeChanged);
this.viewerControl.PreviewDrop += new System.Windows.DragEventHandler(this.Viewer_PreviewDrop);
this.viewerControl.Loaded += new RoutedEventHandler(this.ControlLoaded);
return;
.........
.........
//Registering for the KeyEventHandler but couldn't find anyone un-registering it.
private void ControlLoaded(object sender, RoutedEventArgs e)
{
Window parentWindow = this.GetParentWindow(this);
parentWindow.KeyDown += new System.Windows.Input.KeyEventHandler(this.WindowOnKeyDown);
}
Could you please look into this problem and advice?
Providing a sample project showing problem will be time consuming for me.
Thanks,
Sandeep