如何在加载大型电子表格时修复 java.lang.OutOfMemoryError

如何在加载大型电子表格时修复 java.lang.OutOfMemoryError

Aspose.Cells API 提供内存首选项以优化加载和处理电子表格时的内存消耗。这些选项也有助于有效地加载包含工作簿对象中大量数据集的大型电子表格,如下所示。

Java

 //Specify the LoadOptions

LoadOptions options = new LoadOptions();

//Set the memory preferences

options.setMemorySetting(MemorySetting.MEMORY_PREFERENCE);

//Instantiate the Workbook

//Load the Big Excel file having large Data set in it

Workbook book = new Workbook("sample.xlsx", options);