When I return for example a pdf from my controller, my application pool spikes up, if I download the file 10 times, my app pool crashes, is there any way to clear the memory after sending the file?
I Used
return File(ByteArrayOfFile, "application/pdf","Report");
Or
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition",
string.Format("attachment; filename=" + " " +
DateTime.Now.ToShortDateString() + ".pdf"));
Response.BinaryWrite(contents);
But my app spool still spikes when I download the file