cancel
Showing results for 
Search instead for 
Did you mean: 

Server has not enough memory for operation (Some .rpt files not removing from Temp folder )

Former Member
0 Kudos

We have web application developed in ASP.NET 4.0 ftramework and published on IIS. And we are using 13_0_8 version of CR.


I am creating report files and exporting these as pdf. And I am disposing streams and report documents at the end. Initially, there wasn't any problem and temporary files which are created by CrystalReport were deleting all. But, now requests to the web application increeased to about 50.000 in a day and now some .rpt files are staying in Temp folder and I can't delete them. After recycling application pool all files are removed by IIS. Then, after 1 or 2 hours new .rpt files are creating in Temp folder. And after somewhile, application throws Server has not enough memory for operation. And, IMHO the reason is temp files. Here is the code I am using to export report as pdf.


Questions:

1. Is the reason of this exception is temp files in Temp folder?

2. What is wrong in that code?


ReportDocument report = DownloadPDF.GetReport(id);

  
MemoryStream stream = (MemoryStream)report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
  
Response.ContentType = "application/pdf";
  
Response.AddHeader("content-disposition", "attachment; filename=" + id+ ".pdf");

  report
.Close();
  report
.Dispose();
  
try
  
{
  
Response.BinaryWrite(stream.ToArray());
  
Response.End();
  
}
  
catch (Exception)
  
{

  
}
  
finally
  
{
  stream
.Flush();
  stream
.Close();
  stream
.Dispose();
  
}



Here is the StackTrace


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Likely nothing wrong in this part of the code.

Reason is the report is likely failing due to some other issue so those temp files cannot be "cleaned up" by the engine.

50K report is a lot, you could either be running out of licenses or simply trying to pass too many reports to quickly to the RAS.

You need to start  limiting the number of jobs are one time.

For scalability you should also move to CRS or full BOE 4.0 or 4.1 and use RAS as a Service to process that many reports.

If that's not an option then start building in limitations, wait for the previous job to complete before passing in the next job.

This is known limitations of inProc RAS, nothing you can do through code other than limit the number of jobs.

Also, CR requires Contiguous memory space, IIS cannot defrag memory on the fly like UNIX memory managers can and Microsoft also recommends cycling IIS for this reason.

Don

Former Member
0 Kudos

I had such purpose to test some Report Engines. And Firstly, I have tried Crystal Report.  My idea was that, to get license if everything would be ok. But, now this exception is apperaed. And, we can't make the decision to get the license or not.

Will this solve the problem for sure? Or I need anything else?

Thanks for the answer.

former_member183750
Active Contributor
0 Kudos

Well, I would say with any software, there is never a "for Sure" (?)

However, you can try by using the eval of CR Server:

SME Free Trials | SME Software | SAP

Using CRS and the SDK will not be as simple as the Crystal Reports SDK though. I'd suggest looking at the following:

Programming the RAS Insight 2007 | SCN

NET RAS SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki

Report Application Server .NET SDK Developer Guide

Report Application Server .NET API Guide

- Ludek

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hi Farhad

At 50,000 requests, you are more than likely running into the CR engine limit. E.g.; you're pushing way too hard... The following will be good reads for you:

Crystal Reports 2008 Component Engine Scalability | SCN

(The above doc does apply to current versions of CR - e.g.; no changes.)

Crystal Reports Maximum Report Processing Jobs ... | SCN

Scaling Crystal Reports for Visual Studio .NET

How Can I Optimize Scalability?

All of the above apply to your version of CR and thus the next question will be; how to proceed:

1) Bigger, faster servers will not hurt.

2) Web farms.

How Do I Use Crystal Reports in a Web Farm or Web Garden?

3) Crystal Reports Application Server, or perhaps even SAP BusinessObjects BI Platform 4.1

Crystal Enterprise Report Application Server - Overview

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter