System.OutofMemoryException was thrown appears then it affects other users

Stimulsoft Reports.WEB discussion
Post Reply
junixquiaoit
Posts: 38
Joined: Thu Jun 23, 2016 2:03 am

System.OutofMemoryException was thrown appears then it affects other users

Post by junixquiaoit »

Hi,

I'm intermittently encountering this error suddenly.
outofmemory.png
outofmemory.png (36.68 KiB) Viewed 2823 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.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

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

Post 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.
junixquiaoit
Posts: 38
Joined: Thu Jun 23, 2016 2:03 am

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

Post 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.
Lech Kulikowski
Posts: 7308
Joined: Tue Mar 20, 2018 5:34 am

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

Post by Lech Kulikowski »

Hello,

You are welcome.
junixquiaoit
Posts: 38
Joined: Thu Jun 23, 2016 2:03 am

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

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

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

Post 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.
Post Reply