Page 1 of 2

Memory Load best practices

Posted: Mon May 09, 2011 6:07 am
by Houssam Hamdan
Greetings,

We are using Stimulsoft Reports.Net 2011.1 release.

We have developed a console application to measure the Physical Memory Peak Working Set value for different amount of rows. Results as follows:

1,000 rows - > 28.52 MB
10,000 rows - > 58.37 MB
100,000 rows - > 341.12 MB

C# Code snippet:

Reports.Report objReport = new Reports.Report(); // Precompiled assembly
List objBooks = GetBooks(_intNumberOfRecords);
objReport.RegBusinessObject("Book", "Book", objBooks);
objReport.Render(false);
objReport.ExportDocument(StiExportFormat.Excel2007, _strFilePath);

Question:

Is there a better way to export the file with less amount of memory consumed ? Something like lazy loading ?

Thank you in advance.

Memory Load best practices

Posted: Mon May 09, 2011 4:42 pm
by Ivan
Hello,

Please try to set the ReportCacheMode property of the report to On.

Thank you.

Memory Load best practices

Posted: Tue May 10, 2011 12:34 am
by Houssam Hamdan
Hi Ivan,

New figures for ReportCacheMode = True:

1,000 rows - > 28.5 MB
10,000 rows - > 82.85 MB
100,000 rows - > 580.4 MB

It is important to mention the following for 100,000 rows export:

1- The export is much much slower which is expected.
2- The peak remained at 68 MB for approx. 3 minutes at the beginning then suddenly increased crazily to reach the above figure.

Waiting for your reply.

Cheers

Memory Load best practices

Posted: Tue May 10, 2011 4:42 am
by Fabio Pagano
Don't know if this can help, but i have solved memory problems with this code:

Code: Select all

Dim Report As Stimulsoft.Report.StiReport = New Stimulsoft.Report.StiReport
Dim CacheFolder As String = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "StimulsoftReportsCache")
If Not System.IO.Directory.Exists(CacheFolder) Then
   System.IO.Directory.CreateDirectory(CacheFolder)
End If
Report.ReportCachePath = CacheFolder
Report.ReportCacheMode = Stimulsoft.Report.StiReportCacheMode.On
Report.RenderedPages.CanUseCacheMode = True
Report.RenderedPages.CacheMode = True
Report.RenderedPages.Clear()

...create report here
Thank you.

Memory Load best practices

Posted: Tue May 10, 2011 5:53 am
by Houssam Hamdan
Hi Fabio,

Your code did not mitigate the memory peak, it has the same impact as setting the ReportCacheMode property to On.

The files, which have GUID names, are created inside the StimulsoftReportsCache folder but no improvement in memory consumption.

Thank you.

Memory Load best practices

Posted: Wed May 11, 2011 7:53 am
by Andrew
Hello,

The ReportCacheMode property affects the rendering of the report.
Exports in table mode (rtf, word, excel, csv) currently do not support caching, but it is in our plans for this year.
In some cases reducing the memory consumed can be achieved by changing the design.
Please send us a sample report template with data or a simple test project, and we'll see what can be done.

Thank you.

Memory Load best practices

Posted: Thu May 12, 2011 3:09 am
by Houssam Hamdan
Hi Andrew,

As per your request, I have attached the test project.

Thx & regards,

Memory Load best practices

Posted: Fri May 13, 2011 1:11 am
by Houssam Hamdan
Hello again,

Figures for ReportCacheMode = True & Export Format = pdf

1,000 rows - > 30.4 MB
10,000 rows - > 59.9 MB
100,000 rows - > 84.45 MB

Great !!!

We are looking forward to receive the same for excel format in your future release.

Thx a lot

Memory Load best practices

Posted: Fri May 13, 2011 3:19 am
by Houssam Hamdan
Andrew,

Could you please let us know the release date for caching support ?

Thank you.

Memory Load best practices

Posted: Tue May 17, 2011 4:30 am
by Andrew
Hello,

We have investigated your project. Your report is built correctly and there is nothing to optimize.
So the only workaround now is caching when you export.
The exact date of implementation cannot be called until we have tasks of higher priority.
Approximately it is the end of summer - autumn.

Thank you.