Page 1 of 1

Deallocate memory

Posted: Mon Oct 05, 2020 12:34 pm
by r.bianco
Reports.Web 2020.4.1.0

Good morning,
in the web application where we use the stimulsoft reports we have a problem of non-deallocated memory.
After exporting the report, how can I deallocate the memory used?

Code: Select all

StiReport myReport;
myReport = new StiReport();
[...]
myReport.Compile();
myReport.Render(false);
Stimulsoft.Report.Export.StiPdfExportSettings stiSet = new Stimulsoft.Report.Export.StiPdfExportSettings();
stiSet.ImageQuality = 1;
stiSet.ImageResolutionMode = Stimulsoft.Report.Export.StiImageResolutionMode.Auto;
myReport.ExportDocument((StiExportFormat)Formato, pathFileEsportazione, stiSet);
myReport = null;

Re: Deallocate memory

Posted: Mon Oct 05, 2020 2:13 pm
by Lech Kulikowski
Hello,

Please check the following topic:
viewtopic.php?f=8&t=131

Also, instead of the
myReport = null;

should be
myReport.Dispose();
myReport = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();

Thank you.

Re: Deallocate memory

Posted: Mon Oct 05, 2020 3:15 pm
by r.bianco
It works!
Thanks a lot.

Re: Deallocate memory

Posted: Tue Oct 06, 2020 5:13 am
by Andrew
Hello,

Okay, great!