Memory Load best practices

Stimulsoft Reports.NET discussion
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post 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.
Attachments
1009.PerformanceAnalysis.7z
(1.12 MiB) Downloaded 448 times
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Memory Load best practices

Post by Ivan »

Hello,

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

Thank you.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post 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
User avatar
Fabio Pagano
Posts: 355
Joined: Mon Apr 16, 2007 12:38 pm
Location: Bari (Italy)

Memory Load best practices

Post 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.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post 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.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Memory Load best practices

Post 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.
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post by Houssam Hamdan »

Hi Andrew,

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

Thx & regards,
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post 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
Houssam Hamdan
Posts: 33
Joined: Fri Aug 20, 2010 3:46 am
Location: Lebanon - Beirut

Memory Load best practices

Post by Houssam Hamdan »

Andrew,

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

Thank you.
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Memory Load best practices

Post 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.
Post Reply