OOM When open a PDF file with PdfFileInfo

Hi

I am using Aspose PDF 17.9 to get information of PDF files
Here is my code for test:

boolean result = true;
String fileName = “41_.pdf”;
PdfFileInfo pdfFileInfo = new PdfFileInfo(new FileInputStream(“custom/input/pdf/” + fileName));
result = pdfFileInfo.hasOpenPassword();

Issue:
An exception of OOM will be thrown like this:

Caused by: java.lang.OutOfMemoryError: Java heap space
at com.aspose.pdf.internal.ms.System.IO.z32.m1(Unknown Source)
at com.aspose.pdf.internal.ms.System.IO.z32.m3(Unknown Source)
at com.aspose.pdf.internal.ms.System.IO.z32.write(Unknown Source)
at com.aspose.pdf.internal.p952.z3.m1(Unknown Source)
at com.aspose.pdf.internal.ms.System.IO.Stream.fromJava(Unknown Source)
at com.aspose.pdf.facades.Facade.bindPdf(Unknown Source)
at com.aspose.pdf.facades.PdfFileInfo.(Unknown Source)
at com.aspose.pdf.facades.PdfFileInfo.(Unknown Source)

https://1drv.ms/b/s!AjZYjGcEAKU_g_JyRGOaH7qU8GnkNw

I have uploaded this PDF file.
Please check attachment and this issue. Thank you.

Craig

@craig.w.su

Thanks for contacting support.

We have tested the scenario in our environment and managed to replicate the issue which you have mentioned. Therefore, we have logged an issue as PDFJAVA-37195 in our issue tracking system. We will further investigate the reasons behind this issue and keep you posted with the status of its resolution. Please be patient and spare us little time.

We are sorry for the inconvenience.

@craig.w.su

Thanks for your patience.

In the result of investigation by our product team, the issue was related to heap size. Please note that as the file size is 763.9MB and, for just opening, it needs at least 2.4GB of free heap memory (as some objects should be unpacked before analysis), so VM options should be set as Xmx2400M (more is better). Please try your scenario by increasing heap memory and in case you still face any issue, please feel free to let us know.