I'm having a similar problem with memory not being de-allocated when the workbook/worksheet are disposed.
I have created a datatable and am creating a workbook/worksheet directly from it:
Any advice on how I can release this memory?
Thanks,
Rusty
I have created a datatable and am creating a workbook/worksheet directly from it:
Try
Dim WorkBook As XLWorkbook = New XLWorkbook()
WorkBook.CalculateMode = XLCalculateMode.Manual
Dim WorkSheet As IXLWorksheet = WorkBook.Worksheets.Add(SheetName)
WorkSheet.Cell(1, 1).InsertTable(Datatbl.AsEnumerable()) 'insert the entire datatable
WorkBook.SaveAs(XLSPathFileName)
WorkSheet.Dispose()
WorkBook.Dispose()
Catch ex As Exception
LOG("CreateXLS error: " & ex.Message)
End Try
After this has completed, the workbook/worksheet look great but it leaves me with over 150 MB of allocated memory when the application usually has about 15MB prior to workbook creation. I also dispose the datatable right afterwards as well.Any advice on how I can release this memory?
Thanks,
Rusty