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
close icon

Urgent:Insufficient memory to continue the execution of the program

Hi ,

i am trying to bind 75000 rows with 58 columns to worksheet using syncfusionv8.403.0.10
and gettting exceptions like,

1)
Message: Insufficient memory to continue the execution of the program.
StackTrace: at Syncfusion.XlsIO.Parser.Biff_Records.IntPtrDataProvider.EnsureCapacity(Int32 size)
at Syncfusion.XlsIO.Implementation.SSTDictionary.SetRefCount(Int32 index, Int32 count)
at Syncfusion.XlsIO.Implementation.SSTDictionary.AddIncrease(Object key, Boolean bIncrease)
at Syncfusion.XlsIO.Implementation.RangeRichTextString.EndUpdate()
at Syncfusion.XlsIO.Implementation.RangeImpl.set_Text(String value)

2)
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
StackTrace: at System.Runtime.InteropServices.Marshal.ReadInt32(IntPtr ptr, Int32 ofs)
at Syncfusion.XlsIO.Parser.Biff_Records.IntPtrDataProvider.ReadInt32(Int32 iOffset)
at Syncfusion.XlsIO.Implementation.SSTDictionary.AddIncrease(Int32 index)
at Syncfusion.XlsIO.Implementation.SSTDictionary.AddIncrease(Object key, Boolean bIncrease)
at Syncfusion.XlsIO.Implementation.RangeRichTextString.EndUpdate()
at Syncfusion.XlsIO.Implementation.RangeImpl.set_Text(String value)

3)
Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
StackTrace: at Syncfusion.XlsIO.Implementation.Memory.RtlZeroMemory(IntPtr ptrDest, Int32 iSize)
at Syncfusion.XlsIO.Parser.Biff_Records.IntPtrDataProvider.ZeroMemory()
at Syncfusion.XlsIO.Implementation.SSTDictionary.RemoveUnnecessaryStrings()
at Syncfusion.XlsIO.Implementation.XmlSerialization.Excel2007Serializator.SerializeSST(XmlWriter writer)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveSST()
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveWorkbook(ExcelSaveType saveAsType)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveDocument(ExcelSaveType saveType)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveDocument(Stream stream, ExcelSaveType saveType)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.SaveDocument(String filename, ExcelSaveType saveType)
at Syncfusion.XlsIO.Implementation.XmlSerialization.FileDataHolder.Serialize(String fullName, WorkbookImpl book, ExcelSaveType saveType)
at Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAs(String FileName, ExcelSaveType saveType, ExcelVersion version)
at Syncfusion.XlsIO.Implementation.WorkbookImpl.SaveAs(String FileName, ExcelSaveType saveType)

Note:
1) In development, its working without these exceptions but when i deploy the code to server its throwing lot of exceptions.
2) if the number of rows are less than 40,00o then its works fine.


PLease reply ASAP.

code:

try

{

while (tdRDR.Read())

{

if (maxRows <= rowPosition)

{

Export_Log.TraceLog("reached the max rows goin to create new sheet, inside the mapdata()..");

CreateSheet();

sheet = workbook.ActiveSheet;

rowPosition = 1;

Export_Log.TraceLog("done create new sheet, inside the mapdata()..");

}

 

for (int columnPosition = 0; columnPosition < tdRDR.FieldCount; columnPosition++)

{

try

{

string dataType = Convert.ToString(tdRDR[columnPosition].GetType());

switch (dataType)

{

case "System.String":

sheet.Range[rowPosition, columnPosition + 1].Text = Convert.ToString(tdRDR[columnPosition]);

break;

case "System.Int32":

sheet.Range[rowPosition, columnPosition + 1].Value2 = Convert.ToInt32(tdRDR[columnPosition]);

break;

case "System.DateTime":

sheet.Range[rowPosition, columnPosition + 1].Value2 = Convert.ToDateTime(tdRDR[columnPosition]);

break;

case "System.Decimal":

sheet.Range[rowPosition, columnPosition + 1].Value2 = Convert.ToDouble(tdRDR[columnPosition]);

break;

default:

sheet.Range[rowPosition, columnPosition + 1].Text = Convert.ToString(tdRDR[columnPosition]);

break;

}

}

catch(Exception exp)

{

skipNextRecord = true;

}

if (skipNextRecord)

{

break;

}

}

rowPosition++;

 

}

}

catch (Exception exp)

{

}

finally

{

tdRDR = null;

}





private void CreateSheet()

{

try

{

sheet = workbook.Worksheets.Create();

sheet.Name = sheetName + "_" + Convert.ToString(workbook.Worksheets.Count - 1);

workbook.Worksheets[workbook.Worksheets.Count - 1].Activate();

}

catch (Exception exp)

{

}

}


Your help would be much appreciated. Thanks in advance


Regards,
Mohankumar.V



3 Replies

JJ Jawahar Jeevanandan J Syncfusion Team July 1, 2011 10:22 AM UTC

Hi Mohan,

Thank you very much for using syncfusion products.

The query addressed in this forrum is similar to incident 82097. Please follow up the incident 82097 for further follow up.

Please let us know if you have any clarifications.

Thanks,
Jawahar.



MB Mathew Baker July 27, 2012 02:21 PM UTC

Dear Jawahar Jeevanandan J,

Useful that you point out I can find the answer to this problem at another incident number (82097), but how do I find that page within the forum? (not forrum)

I'm experiencing the same error when trying to create a worksheet containing 47000+ rows. 

What is the answer to this problem, or at least, give me a link to the solution?

Kind regards,
Mathew Baker
ISIZ BV


SR Sridhar Syncfusion Team July 30, 2012 11:47 AM UTC

Hi Mathew,
 
Thank you so much for the update.
 
We could see the above reported query is related to the incident 97078 and our support enginner will get back to you with the details.
 
Let me know if you require any further assistance on this.
 
Thanks,
Sridhar.S

Loader.
Live Chat Icon For mobile
Up arrow icon