Aspose.cells V20.7 - java.lang.OutOfMemoryError: Java heap space


We try to convert an Excel file to PDF with Aspose.cell 20.7 trial version. We got error about Java heap size.
We used following java options
-Xms2024m -Xmx4098m
-Xms4098m -Xmx6000m

For info, PDF file is created but cannot be read by Acrobat.

We need to solve this issue before purchasing licence. Could you please advise?



Please zip the Excel file and attach it here, we will check your issue soon.

zip file is over 12 Mega. Do you have any share device (cloud)

You may upload the file to some public file sharing server like google drive, dropbox etc and share the link here for downloading. We will test the scenario and share our feedback.

Here is the link to dropbox


Please try our latest version/fix: Aspose.Cells for Java v20.9.2 (attached) (7.2 MB)

I tested your scenario/case by converting your file to PDF and it works fine with the attached version. The output PDF file is ok and can be opened fine into Adobe acrobat. But as the pages are more than 634K, so it takes some time to browse pages in adobe acrobat.

By the way, I checked your Excel file and found that the worksheet named “HS Classifications” has more than 624K pages, so you may imagine why it is taking more time to render the PDF file. I also noticed there are unnecessary blank pages mostly in the worksheet “HS Classifications”.

I try it with version 20.9.2 but still having trouble.
java.lang.OutOfMemoryError: Java heap space
at com.aspose.cells.zbdr.a(Unknown Source)
at com.aspose.cells.zbd.d(Unknown Source)

I use these java option:
-Xms4048m -Xmx6000m

Source code:
public static String convertCells2PDF(String sourceFile, String outputFile) {
Workbook workbook;
try {
workbook = new Workbook(sourceFile);
//This line is important-------------------

		PdfSaveOptions opts = new PdfSaveOptions();
		// Save the document in PDF format, opts);
		return outputFile;
	catch (Exception e) {
		return null;


Your code is not right as you are trying one page per sheet option on. Since some worksheets have thousands of pages so how could you make one page for those bigger sheets. Please note, this option would consume more and more resources for no output. Kindly do not set this option in code and then try your scenario.

Thank you, it works fine now.

You are welcome.