Server has not enough memory for operation (Some .rpt files not removing from Temp folder )
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.
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");
Here is the StackTrace