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

ExcelRW memory Leak

Each time i run this code, the memory grows and is NEVER reclaimed: Any idea ? Is ther a memory leak on ExcelRW ? ExcelEngine excelEngine = new ExcelEngine(); IApplication application = excelEngine.Excel; IWorkbook myWorkBook = excelEngine.Excel.Workbooks.Add(); IWorksheet sheet = myWorkBook.Worksheets[0]; for (int i = 0;i<=grid.RowCount;i++) { sheet.Range[i+1,1].RowHeight = (grid.RowHeights[i]/1.33); for(int j=0; j<=grid.ColCount;j++) { if(grid[i,j].HasBaseStyle) { sheet.Range[i+1,j+1].CellStyleName = grid[i,j].BaseStyle.ToString(); } sheet.Range[1,j+1].ColumnWidth = (grid.ColWidths[j]/7.43); sheet.Range[i+1,j+1].Value2 =grid[i,j].Text ; } }

7 Replies

AD Administrator Syncfusion Team June 20, 2005 11:37 AM UTC

WHY NO ONE ANSWERS MY QUESTION ? >Each time i run this code, the memory grows and is NEVER reclaimed: >Any idea ? Is ther a memory leak on ExcelRW ? > >ExcelEngine excelEngine = new ExcelEngine(); >IApplication application = excelEngine.Excel; >IWorkbook myWorkBook = excelEngine.Excel.Workbooks.Add(); >IWorksheet sheet = myWorkBook.Worksheets[0]; > > > for (int i = 0;i<=grid.RowCount;i++) > { > > sheet.Range[i+1,1].RowHeight = (grid.RowHeights[i]/1.33); > > for(int j=0; j<=grid.ColCount;j++) > { > if(grid[i,j].HasBaseStyle) > { > sheet.Range[i+1,j+1].CellStyleName = grid[i,j].BaseStyle.ToString(); > } > > sheet.Range[1,j+1].ColumnWidth = (grid.ColWidths[j]/7.43); > sheet.Range[i+1,j+1].Value2 =grid[i,j].Text ; > } > }


EL Erik Larson June 20, 2005 02:07 PM UTC

I am having the exact same problem. Let me know if you figure out what is going on.


AD Administrator Syncfusion Team July 21, 2005 04:11 PM UTC

I think the problem is that you need to invoke Close on the workbook (of course, ideally in a finnaly block). My tests have shown the same issue, until I added a call to Close on the worksheet. It''s not at all clear to me why Syncfusion did not implement Dispose on the Worbook. Mind you that my tests have shown that the solution above (i.e. call Close when done with the workbook) only solves the issue when you are not creating new worksheets. Any new worksheets added to the workbook will cause the memory to grow and will not be reclaimed, even after you call Close on the workbook.


AD Administrator Syncfusion Team July 21, 2005 07:00 PM UTC

Hi, Currently we are investigating into these Memory usage issues and will have a resolution soon. Please bear with use till then. Thanks, Stephen. >I think the problem is that you need to invoke Close on the workbook (of course, ideally in a finnaly block). My tests have shown the same issue, until I added a call to Close on the worksheet. It''s not at all clear to me why Syncfusion did not implement Dispose on the Worbook. >Mind you that my tests have shown that the solution above (i.e. call Close when done with the workbook) only solves the issue when you are not creating new worksheets. Any new worksheets added to the workbook will cause the memory to grow and will not be reclaimed, even after you call Close on the workbook.


AD Administrator Syncfusion Team May 9, 2008 11:05 AM UTC

Did anything ever come of this?

I'm seeing very high memory usage (followed by OOM crash) when exporting a 7000 line table.

Are there improvements in a later syncfusion release (currently using 3.0.1.0 with .Net 1.1)?



AD Administrator Syncfusion Team May 9, 2008 11:06 AM UTC

From windbg:

0x0ce87f60 96,697 7,735,760 Syncfusion.ExcelRW.Implementation.RangeImpl
0x10166894 182,075 11,169,900 Syncfusion.Styles.StyleInfoObjectStore/ObjectEntry[]
0x79ba2f5c 619,566 14,869,584 System.Collections.ArrayList
0x0ce8e7bc 576,561 16,143,708 Syncfusion.ExcelRW.Implementation.ValueChangedEventHandler
0x0ce947ac 1,017,475 16,279,600 Syncfusion.ExcelRW.Implementation.ExtendedFormatImplWrapper
0x10166220 1,045,570 18,572,668 System.Collections.Specialized.BitVector32[]
0x0ce9a1ac 460,392 25,781,952 Syncfusion.ExcelRW.Implementation.StyleImpl
0x0ce84ff4 460,392 29,465,088 Syncfusion.ExcelRW.Implementation.Collections.BordersCollection
0x00e62970 50,235 32,226,792 System.Collections.Hashtable/bucket[]
0x0ce93d5c 920,791 36,831,640 Syncfusion.ExcelRW.Implementation.ExtendedFormatImpl
0x0014e410 911 40,079,868 Free
0x0ce95294 1,580,750 44,261,000 Syncfusion.ExcelRW.Implementation.FontImplWrapper
0x00e6209c 748,363 62,477,424 System.Object[]
0x1c8b6a94 920,792 62,613,856 Syncfusion.ExcelRW.Parser.Biff_Records.ExtendedFormatRecord
0x0ce94dac 1,473,521 64,834,924 Syncfusion.ExcelRW.Implementation.FontImpl
0x79b946b0 1,634,332 77,836,800 System.String
0x1c8b7b64 1,473,522 82,517,232 Syncfusion.ExcelRW.Parser.Biff_Records.FontRecord
0x0ce8fce0 2,762,352 88,395,264 Syncfusion.ExcelRW.Implementation.BorderImpl



YG Yavanaarasi G Syncfusion Team May 13, 2008 10:52 AM UTC

Hi Paul,

Yes. We have improve the performance in our latest version. We recommend you to upgrade our latest public release of Essential Studio 2008 Volume 2.

You can download the latest version from the below forum thread:
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=72983

Unlock key:
If your Essential Studio license is current, you will be able to obtain the key to install this version from your account in DirectTrac. Otherwise, please contact your Syncfusion Sales Representative or e-mail salessupport@syncfusion.com.

Please let me know if you have any other concerns.

Regards,
G.Yavana



Loader.
Live Chat Icon For mobile
Up arrow icon