Page 1 of 1

System.OutofMemoryException was thrown appears then it affects other users

Posted: Tue Oct 13, 2020 3:54 am
by junixquiaoit
Hi,

I'm intermittently encountering this error suddenly.
outofmemory.png
outofmemory.png (36.68 KiB) Viewed 2821 times

There are approximately 35 active concurrent users using our application. I've checked the report source and it wouldn't be producing many pages, because the datasource is already filtered. The memory of the server is at 60% utilization. Then, when this error happens, it affects other users that calls another report, which I want to know also why. Are there any properties that I should set to prevent other users become affected and prevent the System.OutofMemoryException was thrown appears?

I've found these properties, but cannot thoroughly understand if these will solve my problem:
  • CacheMode = Stimulsoft.Report.Web.StiServerCacheMode.None

For other information:
  • The object used to render report is the same for all users. That's why possibly if the one user encountered it, it will be encountered by other users.
  • Stimulsoft Asp.Net MVC Version is 2019.2.1.0 - HTML5 Viewer
  • Don't have any value set on CacheMode Property
  • To stop the error, I've restarted the IIS on our web server and it is now working, but how I can prevent this from happening again

Thanks.

Re: System.OutofMemoryException was thrown appears then it affects other users

Posted: Wed Oct 14, 2020 1:23 pm
by HighAley
Hello,

Did you read the next article about using report assemblies?

https://stimulsoft.zendesk.com/hc/en-us ... assemblies

How do you load the report?
Could you try our latest build?

Thank you.

Re: System.OutofMemoryException was thrown appears then it affects other users

Posted: Thu Oct 15, 2020 1:24 am
by junixquiaoit
Thank you for the response. I haven't read about using report assemblies, thank you for the reference link. I will try this if this could solve our problem.

Also, we load the report like this:

StiReport report = new StiReport();

return StiMvcViewer.GetReportResult(report);


HighAley wrote: Wed Oct 14, 2020 1:23 pm Hello,

Did you read the next article about using report assemblies?

https://stimulsoft.zendesk.com/hc/en-us ... assemblies

How do you load the report?
Could you try our latest build?

Thank you.

Re: System.OutofMemoryException was thrown appears then it affects other users

Posted: Thu Oct 15, 2020 10:06 pm
by Lech Kulikowski
Hello,

You are welcome.

Re: System.OutofMemoryException was thrown appears then it affects other users

Posted: Tue Oct 20, 2020 8:31 am
by junixquiaoit
Hi,

I would like to clarify if this is the proper arrangement of codes I should do:

StiReport report = new StiReport();

string folder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
folder = Path.Combine(folder, "Stimulsoft\\CompiledReports");
folder = Path.Combine(folder, System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion().ToString());
string compiledReportFile = Path.Combine(folder, report.GetReportAssemblyCacheName());

if (System.IO.File.Exists(compiledReportFile))
{
System.IO.File.Delete(compiledReportFile);
report.Compile(compiledReportFile);
}
else
{
if (!Directory.Exists(folder)) Directory.CreateDirectory(folder);
report.Compile(compiledReportFile);
}
report.Render(false);

return StiMvcViewer.GetReportResult(report);

I have tried this and notice that there would be file creation and wandering that in the long run it would take up space. Are there any suggested actions I should do if I will implement this? Or this is one of the disadvantages of using this way?

Thank you.

Lech Kulikowski wrote: Thu Oct 15, 2020 10:06 pm Hello,

You are welcome.

Re: System.OutofMemoryException was thrown appears then it affects other users

Posted: Tue Oct 20, 2020 10:20 am
by HighAley
Hello.

You could find other solutions here:
https://stimulsoft.zendesk.com/hc/en-us ... assemblies

It seems that you tool the code from this article.

Thank you.