1

I need to get 400-500k data in excel output, but in the Worksheet.SaveAs (stream) part, the data takes up 6gb of ram at a time and the application closes when the ram is not enough on the computer. What I want is to get excel output, but even if it cannot do this, I want to at least prevent the application from closing. What should I do for this?

sample excel data: enter image description here

this is the sample code (I can't show it because some parts are private) enter image description here

error enter image description here

This application will run on the server and its current features are 12gb ram 4 core cpu, at least how much do you think we should increase these features?

  • you can try to use paging, try to load 100 row in one request and append the data in file – NAS Mar 02 '21 at 18:03
  • Unfortunately it is not possible, I have to show 600k data on a single page. – Sakin WarTera Mar 02 '21 at 19:19
  • Which version of ClosedXML version are you using? From [this link](https://github.com/ClosedXML/ClosedXML/issues/86), it seems that [ClosedXML 0.93.0-beta2](https://www.nuget.org/packages/ClosedXML/0.93.0-beta2) has been released and should address this issue, try to use this version. – Zhi Lv Mar 03 '21 at 08:06
  • i use 0.95 version, should I replace it with the version you said? – Sakin WarTera Mar 03 '21 at 12:38
  • I'm not sure about that, you can have a try. Besides, since this issue is related to ClosedXML, I think you could also post this question on the [ClosedXML github forum](https://github.com/ClosedXML/ClosedXML/issues). – Zhi Lv Mar 04 '21 at 07:49

0 Answers0