Q: I am converting large Excel documents with many sheets. Can I reduce the peak memory usage when doing so?
A: Yes. The SetIncrementalSave option can be used to save the document to disk incrementally during conversion (default is to perform the entire conversion in RAM + temp files). This process will reduce the peak memory usage during the conversion for large documents with many excel sheets.
Note while saving the document with the e_incremental flag can reduce the overall conversion time, it can result in a larger overall file size. If you need to save the document with the e_linearized option (Fast WebView), a full re-save will need to be performed.
Additionally, note that also have the SetExcelMaxAllowedCellCount option that can be used to limit the conversion of large excel files. The conversion will throw an exception if the number of cells in a Microsoft Excel document is above the set MaxAllowedCellCount, which can be gracefully handled by your application logic.
This might be useful to set as some files can use quite a bit of RAM to convert if they contain a very large amount of cells in one sheet. Setting this value to 250000 will allow the vast majority of Excel documents to convert without issue, while keeping RAM usage to a reasonable level.