Excel File Download causes worker process to exceed 100MB memory limit

Discussion in 'ASP.NET / ASP.NET Core' started by automotivew, May 25, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello,

    MyAsp.Net website allows Users to generate Excel file downloads of data. The largest XLS file that a User can generate is currently 13.7MB. The XLS file is successfully created and downloaded by the User, however the User session is destroyed because the server system is configured to recycle process when memory usage exceeds 100 MB. DiscountAsp.Net tech support monitored the server process for me and found that when the XLS file download button is clicked the worker process (w3wp.exe) memory usage jumped from 30MB to 250MB in less than 2 seconds.

    For anybody who has experience with Excel file downloads, is this spike normal? I.e. is 250MB of memory usage ALWAYS going to be the requirement for the download of a 13.7MB Excel file? If not then I know that I have to concentrate solely on the situation that causes the 250MB spike in memory usage. If such a large spike is unavoidable then I can eliminate having to worry about a memory leak causing the 250MB spike, thanks!
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    It is hard to say. Are you generating the xls file on the file using OWC or other components?


    Have you tested this on your local computer? Were you able to replicate the problem?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Yes, it was tested by our developers who experienced the same memory spike (they report 255MB spike immediately upon clicking the download button). For the moment the developers appear stuck on this issue.

    I would like to know whether a 250 MB spike in memory requirements is considered unavoidable (i.e. normal)when initiating an Excel file download of 13.7 MB. Then I will know better on how to concentrate on solving this issue, thanks!

    If the memory spike can be avoided programmaticaly, then the developers need to figure out how. If the memory spike is not avoidable(lets hope this is not the case) then I'm not sure what measures to take (I'll cross that bridge whenI get there).

    Thank you all!
     
  4. Oops, forgot this part of your question "Are you generating the xls file on the file using OWC or other components?" Answer: I'm not sure what OWC stands for, sorry!
     
  5. Bruce

    Bruce DiscountASP.NET Staff

    I have seen many people generating excel but I have yet to hear about such high memory usage.

    I think the problem can be resolved on the application side but I can't be certain.

    Note that process w/ high memory usage is not stable, eg. ASP.NET usually act up if memory usage exceeds 600MB.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  6. I believe the OWC in this case would be for Office Web Component.
     
  7. Ok, I asked our developers and they said we are generating the XLS file using HtmlTextWrite to write the data into the Excel file.


    I hope the above helps! I don't know whether or not a 250MB memory spike is considered 'normal' or 'unavoidable' with this particular HtmlTextWrite method. Does anybody know for sure? Thanks!


    Post Edited (Dave5126008) : 5/29/2007 12:27:44 PM GMT
     
  8. Bruce

    Bruce DiscountASP.NET Staff

    I haven't tested using HTMLTextWrite to pump out xls files but I can ensure you that such large memory consumption is not very scalable and will cause you problem even when you host on a dedicated box.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  9. Hi, thanks for your help so far. If I request that our developers recode the Excel File generation process, then are there any suggestions (preferences) for the method to use? Hopefully, they can use a method that others on this forum can more readily help with, in the event the problem persists or another issue develops, thanks!


    Ourdevelopers are currently using ASP 1.1 and a VS Studio 2003 environment to develope our online application.
     
  10. Additional information. Here is the entire block of code covering the process where the XLS file is generated. If it would help, please see the attachment, thanks!


    Any suggestion would be greatly appreciated!
     

    Attached Files:

  11. Bruce

    Bruce DiscountASP.NET Staff

    Can't really promise anything but we'll take a peek at it if we have time.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  12. That would be greatly appreciated. I'm completely stumped and out of options here on this, thanks!
     
  13. Bruce

    Bruce DiscountASP.NET Staff

  14. Hello everybody!


    This issue still remains critical and unresolved for my application. Reviewing the code might be helpful, but if that doens't yield anything, I want to know if anybody thinks using a different XLS generation method (other than HTMLTextWrite) will have any effect. My developer seems to think that because the XLS file to be generated is so large (13.6 mb at present) that such a large memory spikemay be normal. I hope that this is not the case and am willing to have him reprogram the entire XLS generating method if necessary to avoid the Session Termination issue which results from the memory spike causing the application to recycle at the DiscountAsp.Net server. When this happens, logged-in Users are having their session lost in the middle of their visit!


    Thanks!
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page