OutOfMemoryErrors when trying to convert large PDF to PDF/A

Hi there,

I'm running into OutOfMemoryErrors with a large PDF file (attached). The PDF file is a converted Excel file (converted with Aspose Cells, also attached).

I'm basically just running the PDF -> PDF/A example from your knowledge base (http://www.aspose.com/docs/display/pdfjava/Convert+PDF+to+PDF-A+format):
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ByteArrayOutputStream los = new ByteArrayOutputStream();
Document pdfDocument = new Document(is);
pdfDocument.validate(los, PdfFormat.PDF_A_1B);
pdfDocument.convert(los, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
pdfDocument.save(baos);

Exception:
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.aspose.pdf.internal.p98.z7.m2(Unknown Source)
at com.aspose.pdf.internal.p98.z6.m2(Unknown Source)
at com.aspose.pdf.internal.p98.z10.m1(Unknown Source)
at com.aspose.pdf.internal.p98.z6.m1(Unknown Source)
at com.aspose.pdf.internal.p32.z7.m1(Unknown Source)
at com.aspose.pdf.internal.p32.z7.m1(Unknown Source)
at com.aspose.pdf.OperatorCollection.m7(Unknown Source)
at com.aspose.pdf.OperatorCollection.m2(Unknown Source)
at com.aspose.pdf.OperatorCollection.size(Unknown Source)
at com.aspose.pdf.OperatorCollection$z1.hasNext(Unknown Source)
at com.aspose.pdf.ImagePlacementAbsorber.m2(Unknown Source)
at com.aspose.pdf.ImagePlacementAbsorber.m1(Unknown Source)
at com.aspose.pdf.ImagePlacementAbsorber.visit(Unknown Source)
at com.aspose.pdf.Page.accept(Unknown Source)
at com.aspose.pdf.internal.p93.z6.m25(Unknown Source)
at com.aspose.pdf.internal.p93.z6.m2(Unknown Source)
at com.aspose.pdf.internal.p93.z7.m12(Unknown Source)
at com.aspose.pdf.internal.p93.z6.m1(Unknown Source)
at com.aspose.pdf.ADocument.m1(Unknown Source)
at com.aspose.pdf.Document.m1(Unknown Source)
at com.aspose.pdf.ADocument.m1(Unknown Source)
at com.aspose.pdf.Document.m1(Unknown Source)
at com.aspose.pdf.ADocument.validate(Unknown Source)
at com.aspose.pdf.Document.validate(Unknown Source)
at com.tsystems.ima.rendition.business.boundary.RenditionServiceImpl.convertToPDFA(RenditionServiceImpl.java:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext$Invocation.invoke(ReflectionInvocationContext.java:181)
at org.apache.openejb.core.interceptor.ReflectionInvocationContext.proceed(ReflectionInvocationContext.java:163)
at org.apache.openejb.cdi.CdiInterceptor.invoke(CdiInterceptor.java:128)

OutOfMemoryErrors occured when running with 2, 4, 8 and 16GB of memory for the JVM (Xmx). Tested with Aspose PDF 10.0.1 and 11.4.0.

Kind regards,
Tim

Hi Tim,

Thanks for your inquiry. I have tested your scenario with shared document using Aspose.Pdf for Java 11.4.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWJAVA-35744 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

Best Regards,

The issues you have found earlier (filed as PDFJAVA-35744) have been fixed in Aspose.PDF for Java 19.12.