memory leak using cachemode and IsStopped or finally report

Stimulsoft Reports.NET discussion
Post Reply
muriloruiz
Posts: 30
Joined: Tue Dec 01, 2015 6:19 pm

memory leak using cachemode and IsStopped or finally report

Post by muriloruiz »

Version: 2017.6.1

I'm having memoryleak issues.

I use

Code: Select all

report.compile()
Then I use

Code: Select all

report.render()
, 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.

Code: Select all

Report.ReportcacheMode = StiReportCacheMode.On;

StiOptions.Engine.ReportCache.AmountOfProcessedPagesForStartGCCollect = 1;
StiOptions.Engine.ReportCache.LimitForStartUsingCache = 50;
Example of implementation:

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();
     }

}
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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: memory leak using cachemode and IsStopped or finally rep

Post by HighAley »

Hello.

Each report is compiled to an assembly.
It could not be unload from the memory.
You could get more information on this topic on this article.
https://stimulsoft.zendesk.com/hc/en-us ... assemblies

Thank you.
Post Reply