System.OutOfMemoryException Thrown when saving to Excel

Posted by: striker77s on 8 September 2017, 2:39 pm EST

  • Posted 8 September 2017, 2:39 pm EST

    I am generating a spread that has about 400 tabs with each tab containing about 300 rows by 40 rows of numeric data.  The system easily generates the spread and I can view the data with no issues.  When I try saving the spread it throws the exception System.OutOfMemoryException.  I have tried saving it to both 2003 excel format and 2007 XML format.  Neither attempt will work.  While watching the processing thread on my task manager it consumes about 1.3 GB of memory while trying to save. 

    I have successfully saved all 400 tabs to an excel file when the tabs only contain about 40 rows of data.  It generated an excel file was 7MB.  So they are not overly large files.  I'm not even coming close to hitting any memory limits as I have 8GB total and each 32 bit thread is limited to 2GB.  Any ideas on a solution.

     Computer specs

    Windows 7 x64

    8GB memory 

    RAID 0 system with 4 SSDs

    VB.NET Visual Studio 2008

     

  • Replied 8 September 2017, 2:39 pm EST

    Hello,

    I am unable to replicate the issue at my end with with 400 sheets of data wherein each sheet has
    300 Rows and 40 Columns. All the Sheets are filled with numeric data.
    When i saved the workbook to an excel file or an xml file, no exception
    was thrown at my end with spread latest build 5.0.3518.2008.



    Please have a look at the attached sample and let us know your further observations on the same and if possible please send us the XML of the Spread in order to replicate the issue at my end and proceed further on this.

    Thanks.
    2011/05/case2-outofmemoryexception.zip
  • Replied 8 September 2017, 2:39 pm EST

    I only have VS 2008 so I can't open your VS 2010 example.  However I created my own simple example of a program throwing an out of memory error and attached it.   The example code mimics how I bind a FPSpread to a datatable in my full code.  I have it compile as a 32 bit program so it can run on Windows XP.  I did find that if I compiled it for x64 it successfully runs when saving an excel 2003 file.  It won't save the file, even when compiled for x64, if I use the new XML excel format.   I don't understand why it takes such huge amounts of memory to save a file that ends up less than 75MB.  Any hope of getting it to run on a 32 bit OS?

    2011/06/SavingError.zip
  • Replied 8 September 2017, 2:39 pm EST

    I was working on a similar issue since yesterday. I am not sure if you are the one who has reported that on email as well.
    We have been able to recreate this and have entered this in our system as Bug. This will be fixed in the next maintenance release of Spread for Windows Forms.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels