Page 1 of 1

OutOfMemory Exception in Charts by RenderWithWpf (2014.2)

Posted: Thu Oct 16, 2014 9:38 pm
by sandynith
Hi,

Verstion: 2014.2 Stimulsoft.WPF
I create a StiChart with StiLineSeries with multiple series (using AutoSeriesKeyDataColumn property) and the report has huge amount of data points to plot (roughly 400,000 data points).
If I run and refresh this report multiple times then the RenderWithWpf throws System.OutOfMemory Exception.
This report runs fine for the first two or three times, but after that it throws this exception. The Process memory is hovering around 500 to 600MB (private bytes) at that point.

Exception:
System.OutOfMemoryException occurred
HResult=-2147024882
Message=Exception of type 'System.OutOfMemoryException' was thrown.
Source=Stimulsoft.Report

Here is the Stack trace:
at Stimulsoft.Report.Chart.StiChartHelper.CreateChart(StiChart masterChart, StiChart chartComp)
at Stimulsoft.Report.Engine.StiChartV2Builder.RenderChart(StiChart masterChart)
at Stimulsoft.Report.Engine.StiChartV2Builder.InternalRender(StiComponent masterComp)
at Stimulsoft.Report.Components.StiComponent.InternalRender()
at Stimulsoft.Report.Engine.StiComponentV2Builder.Render(StiComponent masterComp)
at Stimulsoft.Report.Components.StiComponent.Render()
at Stimulsoft.Report.Engine.StiPageHelper.RenderSimpleComponents(StiPage page, StiContainer outContainer)
at Stimulsoft.Report.Engine.StiStaticBandsHelper.Render()
at Stimulsoft.Report.Engine.StiEngine.NewList(Boolean skipStaticBands)
at Stimulsoft.Report.Engine.StiEngine.NewPage(Boolean ignoreKeepContainers)
at Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state)
at Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state)
at Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState)
at Stimulsoft.Report.StiReport.RenderReport(StiRenderState renderState)
at Stimulsoft.Report.StiReport.Render(StiRenderState renderState, StiGuiMode guiMode)
at Stimulsoft.Report.StiReport.RenderWithWpf(Boolean showProgress)
at Cardax.FT.VoltageStiReportHelper.<>c__DisplayClass1d.<InternalRenderReport>b__1b() in c:\Dev\FTMain\Elmo\WPFClient\Common\ReportCommon\VoltageStiReportHelper.cs:line 350

Failing function is:
Stimulsoft.Report.Chart.StiChartHelper.CreateChart(Stimulsoft.Report.Chart.StiChart, Stimulsoft.Report.Chart.StiChart)

The line of code throwing the exception is the following:
List<StiDataItem>[,] listArray = new List<StiDataItem>[array.Length, strArray4.Length];
Where array.Length = 188795 and strArray4.Length = 344

Now, I understand that as my report data points are too many, you are trying to create such a big List and .Net is not able to allocate that much of memory.

What I am wondering is - is there something you guys can do to optimize it?
In 2014.2 the chart rendering is quite fast and as I can see its able to render huge amount of data points in a chart for the first 2 or three times (for the same report).. but after that it starts failing with OutOfMemory - so looks like there is some memory issue which needs investigation and optimization.

Thanks,
Sandeep

Re: OutOfMemory Exception in Charts by RenderWithWpf (2014.2

Posted: Fri Oct 17, 2014 11:15 am
by HighAley
Hello, Sandeep.

Could you send us a sample report template with data.
We need to reproduce the error to make the optimization and improvement.

Thank you.