Huge memory consumption while converting 5MB PDF

Hi,

we are currently trying to convert a simple PDF to PDF/A with Aspose.PDF.
Sadly we are not successful, because of OutOfMemory-Issues.

Code:

      OptimizedMemoryStream ms = new OptimizedMemoryStream(Files.readAllBytes(pdfFile.toPath()));
        try (com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(ms);
             // just write the first Bytes of the protocol
             FixedSizeByteArrayOutputStream logStream = new FixedSizeByteArrayOutputStream(ASPOSE_LOG_MAX_LENGTH)) {
            // ⚡ OOM
            boolean convertResult = pdfDocument.convert(logStream, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete, ConvertTransparencyAction.Default);
            if (convertResult) {
                pdfDocument.save(convertedPdf.getAbsolutePath());
            }
        } finally {
            ms.close();
        }

Attached you find our PDF-File.

Profiling this method leads to memory-usage von ~8GB. Do you have any tips to reduce the amount of RAM?

For our customers we need to aim to PDF files with ~200MB in size.

20Seiten_PDF_A1.pdf (5,1 MB)

@prdeg

Can you please share which JDK version are you using as well as what is the Java Heap Size set in your environment? Please try with 24.9 version as well and let us know what results you got by sharing screenshot of memory consumption. We will log an investigation ticket to address this case accordingly.

Sorry, that I missed this information.

Aspose-PDF: 24.9
Java-SDK: Temurin 21.0.3.9

Here is the Screenshot:
grafik.png (75,1 KB)

So, can you confirm that I haven’t missed any important parameters to improve performance?

@prdeg

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-44447

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.