We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Java: Workbook.save() throws OutOfMemoryError


I am using Aspose.Cells for Java now to open an existing Excel file which will act as a template where I need to insert data into - then save as a new file.

I am basically doing:

Workbook workbook = new Workbook();
FileInputStream fin = new FileInputStream( – file path – );

Cell cell = workbook.getWorksheets().getSheet(0).getCells().getCell(0,0 );


FileOutputStream fout = new FileOutputStream(“C:\test.xls”);
workbook.save(fout); <= OutofMemoryError thrown here

The excel file I am opening is just under 7 megs.

Any insight into this would be greatly appreciated.


Please try the attached latest version v2.1.2.11.

If you still find the issue, kindly post your template file here.

Since you are manipulating large Excel file, please make sure that you have sufficient memory assigned/allotted to JVM to process the file. Kindly make sure that you have provided and extended the JVM memory appropriately to process/save the file. Following is the command line you may use on the Windows XP command prompt to extend the JVM memory accordingly:
java -Xms1024m -Xmx1024m MyTestProgram

Thank you.