This project has moved. For the latest updates, please go here.

Memory Leak?

Jun 27, 2012 at 12:34 AM

First DeLeon,

Thanks for the great effort on ClosedXML, a very impressive piece of work!


I am having problems with what I believe are memory leaks. When my code runs I see the memory usage go up and never come back down again. My logic is simple. Create a Workbook, create empty sheets, process data by adding data to fields in a datatable, store the datatable into the sheet, format the columns/rows of data in the sheets, write out the workbook.

Memory usage climbs as the data is accumulated and then stored in sheets in a workbook. Then the sheet is formatted which again raises memory usage; and finally the workbook is stored and memory usage again rises and then stays at the peak. Memory is only released after the application is closed.

I have tried to delete accumulated data at intermediate steps and dispose of the workbook after I store the file but nothing seems to help.

I have a sample project I can pass on to show the problem. I don't see anywhere to attach a zip file with the project.


Jul 2, 2012 at 9:33 PM

Did you check the "Performance and Memory" section of the documentation tab? If it doesn't help then create a new issue and attach a project that reproduces the problem.


Jul 2, 2012 at 11:33 PM


Thank you very much for taking the time to address this issue., I can only assume that you are very busy with such a large scale project.

I have indeed checked the "Performance and Memory" section and you will probably note that I have included some of your suggestions in my code.

I will upload a sample "skeleton" project in a few minutes.