memory leak using cachemode and IsStopped or finally report
Posted: Mon Jun 19, 2017 6:24 pm
Version: 2017.6.1
I'm having memoryleak issues.
I use
Then I use , in a certain situation I need to cancel the rendering and then I assign the property (report.IsStopped = true);
I have already tried within the render event to throw an exception and assign (report.dispose ()) to force the release of the object.
The rendering of the report is stopped but the memory of the process is not low, getting high, when I send another report the memory keeps going up never downloading, only low when I remove the service.
NOTE: I use the cachemode = true option to avoid high memory costs.
Example of implementation:
I already figured it might be the Dispose of the object when I threw some exception for that reason I forced the dispose in catch, but I can not release the process memory, I think this can be directly connected to the cache, but I do not know how to proceed with this problem.
I'm having memoryleak issues.
I use
Code: Select all
report.compile()
Code: Select all
report.render()
I have already tried within the render event to throw an exception and assign (report.dispose ()) to force the release of the object.
The rendering of the report is stopped but the memory of the process is not low, getting high, when I send another report the memory keeps going up never downloading, only low when I remove the service.
NOTE: I use the cachemode = true option to avoid high memory costs.
Code: Select all
Report.ReportcacheMode = StiReportCacheMode.On;
StiOptions.Engine.ReportCache.AmountOfProcessedPagesForStartGCCollect = 1;
StiOptions.Engine.ReportCache.LimitForStartUsingCache = 50;
Code: Select all
StiOptions.Engine.ReportCache.AmountOfProcessedPagesForStartGCCollect = 1
StiOptions.Engine.ReportCache.LimitForStartUsingCache = 50;
using(var report = new StiReport()){
try{
report .ReportcacheMode = StiReportCacheMode.On;
report.Compile();
report.CompiledReport.Rendering += (e, s) => {
if(service.isCanceld)
((StiReport)s).IsStopped = true;
};
report.Render(false);
}
catch(Exception)
{
report.Dispose();
}
}