While exporting a huge data to excel it consumes more than 1GB memory (RAM) on my machine. And finally I gets "Out of memory exception".
Is there any way by which we can release some memory while exporting to excel?
Will ExportCache.Clear() solve the problem? If yes, how can we call it because ExportCache is a private property in DataPresenterExcelExporter class?
I am already done with setting ExportOptions. Is there any other way to get it done?
Any help is very much appreciated.
Hi Marianne,
Thanks for looking into it.
I am getting the data directly from Database . Being a business related data it is confidential so I can't share that with you any Sample or so. Although I can tell you details of the data as:Number of Rows: 0.2 MillionNumber of Columns: >50
I would suggest you to generate a datasource of 0.2M rows and 50 columns. You can create a datatable with 50 or more columns e.g., Col1, Col2 and so on. Then you can populate them in a For loop for 0.2M records.
While loading this into Grid will consume >256MB. Once you start exporting this to Excel it will start increasing significantly and will reach out to > 1GB in 4 mins. In few seconds you will see "Out of Memory" exception.
I hope this will solve your queries. Please let me know if any more information is required from my side.
Regards,Vikas
Hi,
Would you be able to provide a description of the data that you are exporting, how many columns and rows or perhaps a sample that demonstrates the data that you are creating? If you’re using a viewmodel to load the grid and the code to generate the data, that would be very helpful.
I have built my own sample but it doesn’t generate sufficient data to match your description.
I'm looking into this for you and I’ll post back here as soon as I have more information.