Hello Team,
We are facing an error related to ‘Java Heap Space’ while converting images to a searchable PDF.
Please find the detailed stacktrace error below:
java.lang.OutOfMemoryError: Java heap space at com.aspose.pdf.internal.l70u.lI.lI(Unknown Source) at com.aspose.pdf.internal.l70u.lI.lI(Unknown Source) at com.aspose.pdf.internal.l71n.lI.(Unknown Source) at com.aspose.pdf.internal.l71k.l0f.(Unknown Source) at com.aspose.pdf.internal.l74h.lj.lI(Unknown Source) at com.aspose.pdf.internal.l74h.lj.write(Unknown Source) at java.desktop/javax.imageio.ImageWriter.write(ImageWriter.java:595) at com.aspose.pdf.internal.l69f.lI.lI(Unknown Source) at com.aspose.pdf.internal.l69f.lI.lf(Unknown Source) at com.aspose.pdf.internal.l69f.lI.lf(Unknown Source) at com.aspose.pdf.internal.l69f.lI.lI(Unknown Source) at com.aspose.pdf.internal.l66p.lf.lI(Unknown Source) at com.aspose.pdf.internal.l66p.l1v.lI(Unknown Source) at com.aspose.pdf.internal.l66p.l1v.lI(Unknown Source) at com.aspose.pdf.internal.l66p.l1v.lI(Unknown Source) at com.aspose.pdf.internal.l9f.l0v.lI(Unknown Source) at com.aspose.pdf.internal.l9f.l0v.lI(Unknown Source) at com.aspose.pdf.internal.l9f.l0v.lI(Unknown Source) at com.aspose.pdf.ADocument.convert(Unknown Source) at com.aspose.pdf.Document.convert(Unknown Source) at com.stormed.production.ProductionMain.doOcr(ProductionMain.java:262) at com.stormed.production.ProductionMain.(ProductionMain.java:123) at com.stormed.production.common.ProductionBuilder.run(ProductionBuilder.java:25) at com.stormed.proxy.AppRunner.run(AppRunner.java:26) at com.stormed.proxy.ProxyMain.runApp(ProxyMain.java:352) at com.stormed.proxy.ProxyMain.lambda$main$0(ProxyMain.java:140) at com.stormed.proxy.ProxyMain$$Lambda$252/0x00000008407f7c40.call(Unknown Source) at co.elastic.apm.agent.concurrent.JavaConcurrent$CallableLambdaWrapper.call(JavaConcurrent.java:253) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829)
We are using Java 17 and below are the versions of aspose:
[group: ‘com.aspose’, name: ‘aspose-pdf’, version: ‘23.1’],
[group: ‘com.aspose’, name: ‘aspose-imaging’, version: ‘22.7’]
Could you please help us to identify why the exception occurred? Please reach out if you need any additional information.