Page 1 of 1

memory leak using cachemode and IsStopped or finally report

Posted: Mon Jun 19, 2017 6:24 pm
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.

Re: memory leak using cachemode and IsStopped or finally rep

Posted: Thu Jun 22, 2017 6:45 pm
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.