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. Image for the cookie policy date

Out of memory exception while trying to read

Hi there,
I am getting an out of memory exception while trying to open an xlsx file of about 30 worksheets.

The same algorithm works fine with one or two sheets, even if the file size of the latter is larger - so i guess it's got to do with the number of sheets.

I am the latest ver (4.xx) of xlsIO

Here's the code:
excelEngine = new ExcelEngine();
excelEngine.Excel.Workbooks.Open(filePath, ExcelOpenType.Automatic);

the 2nd line throws an out of memory exception

Same code works fine for sheets with less worksheets, even if those worksheets contain a large number of rows (20000+).

Is there an alternative way of doing this?                    

Thanks,
Chris                   

6 Replies

CT Christos Tatitzikidis January 20, 2013 11:54 AM UTC

Sorry i am actually using XLSIO.Base v10.404.0.53


CT Christos Tatitzikidis January 20, 2013 12:02 PM UTC

This is the stack trace. It's funny because the xlsx file does not contain any images/charts etc.
I have tried all the ExcelParseOptions with no luck!

   at System.Drawing.Graphics.FromImage(Image image)
   at Syncfusion.XlsIO.Implementation.WorkbookShapeDataImpl.AddPicture(Image image, ExcelImageFormat imageFormat, String strPictureName)
   at Syncfusion.XlsIO.Implementation.Collections.HeaderFooterShapeCollection.SetPicture(String strShapeName, Image image, Int32 iIndex, Boolean bIncludeOptions, String preservedStyles)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Shapes.HFImageParser.ParseImageData(XmlReader reader, String shapeName, BitmapShapeImpl shape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Shapes.HFImageParser.ParseShape(XmlReader reader, ShapeImpl defaultShape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseShape(XmlReader reader, Dictionary`2 dictShapeIdToShape, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseVmlShapes(XmlReader reader, ShapeCollectionBase shapes, RelationCollection relations, String parentItemPath)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseVmlShapes(ShapeCollectionBase shapes, String relationId, RelationCollection relations)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseLegacyDrawingHF(XmlReader reader, WorksheetBaseImpl sheet, RelationCollection relations)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseAfterSheetData(XmlReader reader, WorksheetImpl sheet, MemoryStream& streamCF, String strParentPath, Dictionary`2 dictItemsToRemove)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseSheet(XmlReader reader, WorksheetImpl sheet, String strParentPath, MemoryStream& streamStart, MemoryStream& streamCF, List`1 arrStyles, Dictionary`2 dictItemsToRemove, Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.WorksheetDataHolder.ParseWorksheetData(WorksheetImpl sheet, Dictionary`2 dictUpdateSSTIndexes)
   at Syncfusion.XlsIO.Implementation.WorksheetImpl.ParseData(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlReaders.Excel2007Parser.ParseWorksheets(Dictionary`2 dictUpdatedSSTIndexes)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseWorkbook(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.ParseDocument(List`1& themeColors)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseExcel2007Stream(Stream stream, String password)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl.ParseStream(Stream stream, String password, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.WorkbookImpl..ctor(IApplication application, Object parent, Stream stream, ExcelParseOptions options, ExcelVersion version)
   at Syncfusion.XlsIO.Implementation.ApplicationImpl.CreateWorkbook(Object parent, Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(Stream stream, ExcelOpenType openType, String fileName, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String fileName, ExcelOpenType openType, ExcelVersion version, ExcelParseOptions options)
   at Syncfusion.XlsIO.Implementation.Collections.WorkbooksCollection.Open(String fileName, ExcelOpenType openType)




CT Christos Tatitzikidis January 20, 2013 12:08 PM UTC

Also if I convert the xlsx file to xls it works fine!

thanks,
Chris


SR Sridhar Syncfusion Team January 21, 2013 06:43 AM UTC

Hi Christos,
 
Thank you for using Syncfusion products.
 
We suspect the above reported exception occurs while parsing the header and footer images in XlsIO.However, inorder to reproduce the exception at our side we require the excel file which causes the above exception.
Could you please share us with the excel file which reproduces the out of memory exception so that we are able to proceed further on this.
 
Please let me know if you require any further clarifications.
 
Thanks,
Sridhar.S


CT Christos Tatitzikidis January 21, 2013 01:21 PM UTC

Hi Sridhar, and thanks for your prompt reply.

Could you send me an email I could send the file. It's confidential info, so I wouldn't like to share it with the rest of the forum.

Thanks,
Chris


SR Sridhar Syncfusion Team January 22, 2013 10:33 AM UTC

Hi Chris,


 Thank you so much  for the update.


Please open a new direct-trac incident with a simple issue reproducing sample and stack trace of the exception for further follow up on this issue.

 

The Direct – Trac supporting system is an confidential and we are not sharing the files with any of the customers. If you feel the Direct-Trac is not an confidential you can share the files in the secure net transmission by uploading the files on the net with password protection.


Direct-Trac Link:
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents


Please let me know if you require any further clarifications.

 

Thanks,

Sridhar.S


Loader.
Live Chat Icon For mobile
Up arrow icon