We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

System.OutOfMemoryException problem

Thread ID:

Created:

Updated:

Platform:

Replies:

109737 Jul 2,2013 02:25 AM Jul 24,2013 04:43 AM ASP.NET Web Forms (Classic) 12
loading
Tags: XlsIO
Konrad
Asked On July 2, 2013 02:25 AM

Hello,
I have a question about an exception "Out of memory" for the following example:
-----------
DataTable table = .... //DataTable (34 Columns, 122 229 Rows)
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2010;

IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet worksheet = workbook.Worksheets[0];
IRanges bodyRange = worksheet.CreateRangesCollection();

bodyRange.Add(worksheet.Range[2, 1, table.Rows.Count + 1, table.Columns.Count]);
bodyRange.CellStyle.Color = Color.FromArgb(255, 255, 204);
bodyRange.CellStyle.Font.Size = 10;
bodyRange.CellStyle.Font.Color = ExcelKnownColors.Black;
bodyRange.CellStyle.Font.FontName = "Arial";
bodyRange.CellStyle.Font.Bold = false;
bodyRange.CellStyle.Borders.LineStyle = ExcelLineStyle.Thin;
bodyRange.CellStyle.Borders[ExcelBordersIndex.DiagonalDown].ShowDiagonalLine = false;
bodyRange.CellStyle.Borders[ExcelBordersIndex.DiagonalUp].ShowDiagonalLine = false;
bodyRange.RowHeight = 31.50;
----------
Exception message:
System.OutOfMemoryException: .... 'System.OutOfMemoryException'.
   w Syncfusion.XlsIO.Implementation.FontWrapper..ctor()
   w Syncfusion.XlsIO.Implementation.ExtendedFormatWrapper.SetFormatIndex(Int32 index)
   w Syncfusion.XlsIO.Implementation.RangeImpl.CreateStyleWrapper(Int32 value)
   w Syncfusion.XlsIO.Implementation.RangeImpl.CreateStyle()
   w Syncfusion.XlsIO.Implementation.RangeImpl.get_CellStyle()
   w Syncfusion.XlsIO.Implementation.StyleArrayWrapper.set_Color(Color value)
   
   
Dll uses Syncfusion.XlsIO.Web version 9.403.0.62
Windows XP, 2GB RAM, also tested with 4GB RAM
  
  

For Windows console application file generation successfully (output file size ~ 18,2MB)
------------
DataTable table = .... //DataTable (34 Columns, 122 229 Rows)
DateTime importDataTableTime = DateTime.Now;
worksheet.ImportDataTable(table, true, 1, 1, -1, -1, true);
-------------
For Web application (IIS) ImportDataTable throw "out of memory" exception.



Question: Is there any possibility to generate the excel file with the established styles, autoFilter for (datatable 34 columns, ~ 120000rows).
Some other way, workaround for 4 GB of RAM?


Manikandan M [Syncfusion]
Replied On July 5, 2013 12:08 AM

Hi Konrad

 

Thanks for using Syncfusion products.

We suspect that above reported issue occurs due to ‘memory leak issues’ in XlsIO. Memory leak issues have been handled efficiently and it is available in our latest volume 2 releases. So we highly recommend you to upgrade your product to newer version.

 

Download link for latest version:

http://www.syncfusion.com/downloads/latest-version

If still reproduce the issue, please revert back us with issue reproducing sample (or) datas which you import to workbook with sample scenario to reproduce the issue.

Please let us know if you need any clarifications.

Thanks,

Manikandan M.

 

 


Konrad
Replied On July 9, 2013 05:19 AM

Hi
Thanks for reply.
I downloaded the latest version of dll Syncfusion.XlsIO.Web [11.2035.0.25].
And after running the code
-------------
   DataTable table = .... //DataTable (34 Columns, 122 229 Rows)
            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;

            application.DefaultVersion = ExcelVersion.Excel2010;

            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];

            IRanges headerRange = worksheet.CreateRangesCollection();            
            headerRange.Add(worksheet.Range[1, 1, 1, table.Columns.Count]);
            headerRange.CellStyle.Color = Color.FromArgb(192, 192, 192);
-------------
again received exception "OutOfMemory" : 
-------------
Message:Lsi.PlayPaq.LrsCommonBll.DataExportToXls(...)System.OutOfMemoryException: ... 'System.OutOfMemoryException'.
   w Syncfusion.XlsIO.Implementation.FontWrapper..ctor()
   w Syncfusion.XlsIO.Implementation.ExtendedFormatWrapper.SetFormatIndex(Int32 index)
   w Syncfusion.XlsIO.Implementation.RangeImpl.CreateStyleWrapper(Int32 value)
   w Syncfusion.XlsIO.Implementation.RangeImpl.CreateStyle()
   w Syncfusion.XlsIO.Implementation.RangeImpl.get_CellStyle()
   w Syncfusion.XlsIO.Implementation.StyleArrayWrapper.set_Color(Color value)
-------------

Question: Is there any possibility to generate the excel file with the established styles, autoFilter for (datatable 34 columns, ~ 120000rows).
Some other way, workaround for 4 GB of RAM?

Manikandan M [Syncfusion]
Replied On July 11, 2013 02:28 AM

 


Konrad
Replied On July 11, 2013 03:20 AM

any ideas?

Manikandan M [Syncfusion]
Replied On July 11, 2013 03:28 AM

Hi Konrad,

 

We are sorry for the inconvenience.

 

We are able to reproduce the issue “OOM Exception takes place for large data’s” from our side. On analysis, we found that issue occurs due to inline style setting for range collections. We recommend you to create the global style and set it for the entire range to get the better performance as well as memory consumption. We have created the simplified sample with your scenario, but with global style and have shared the same in the below link.

 

Sample link: OOMException_Solution.zip

 

For further reference on global style setting, please go through the below online help link.

http://help.syncfusion.com/ug/windows%20forms/xlsio/default.htm#!Documents/improvingperformance.htm

 

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.


Konrad
Replied On July 12, 2013 06:33 AM

Thank you for your help.
I have another question.

Example: 
worksheet.UsedRange.AutofitColumns ();

For version Syncfusion.XlsIO.Web [11.2035.0.25]- not working
For version Syncfusion.XlsIO.Web [ 9.403.0.62] - working
Why?

Konrad
Replied On July 16, 2013 04:38 AM

Any ideas?
For the new version dll is a different solution AutoFit?

Manikandan M [Syncfusion]
Replied On July 17, 2013 11:54 PM

Hi Konrad,

 

We are sorry for the inconvenience.

 

We are not able to reproduce the issue “Autofit column not works in XlsIO”. We highly request you to update the issue reproducing scenario or sample. so that we can reproduce the issue and update you the solution ASAP.

 

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.

 


Konrad
Replied On July 19, 2013 09:52 AM

Hello
In attachment class and two output files generated
For version Syncfusion.XlsIO.Web [11.2035.0.25] => SampleOne11.2.xlsx
For version Syncfusion.XlsIO.Web [ 9.403.0.62] => SampleOne9.4.xlsx

Column "Q4" not autofit for version 11.2035.0.25




Sample_cb0befd1.zip

Manikandan M [Syncfusion]
Replied On July 24, 2013 01:10 AM

Hi Konrad,

 

Thanks for detailed update.

 

We are able to reproduce the issue “Autofit column does not work properly in XlsIO”. We suspect that this could be a defect and send to the development team for further analysis. Also we request you to create new incident to further follow up on this using below direct trac login.

 

Direct-Trac Link: Login

 

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.

 


Konrad
Replied On July 24, 2013 03:41 AM

Hello, I have last question:)

July 5, 2013 12:08 AM,  You response me : "We suspect That Occurs above reported issue due to 'memory leak issues' in XlsIO. Memory leak issues have been handled efficiently and it is available in our latest volume 2 releases."

Is the memory leak issues have been handled in version 10.4.0.71?
Konrad

Manikandan M [Syncfusion]
Replied On July 24, 2013 04:43 AM

Hi Konrad,

 

Thanks for your update.

 

The enhanced memory leak issue and performance issues are available in our latest version of Essential studio only.

 

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.

 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;