We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

java.lang.OutOfMemoryError while Adding Headers, Footer and watermark to PDF File

Hi Team,

we have a custom Application residing in Tomcat. Tomcat Log shows Out of Memory Error while adding headers, footers and watermarks to PDF File.

Error in Logs:

.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete processing of a request java.lang.OutOfMemoryError at java.util.zip.Deflater.init(Native Method) at java.util.zip.Deflater.(Unknown Source) at java.util.zip.Deflater.(Unknown Source) at com.aspose.pdf.internal.l6n.lI.lI(Unknown Source) at com.aspose.pdf.ContentsAppender.updateData(Unknown Source) at com.aspose.pdf.Stamp.lI(Unknown Source) at com.aspose.pdf.TextStamp.put(Unknown Source) at com.aspose.pdf.Page.addStamp(Unknown Source)08-Sep-2021 16:33:19.021 SEVERE [https-jsse-nio-8443-exec-19] org.apache.coyote.AbstractProtocol$ConnectionHandler.process Failed to complete processing of a request java.lang.OutOfMemoryError at java.util.zip.Deflater.init(Native Method) at java.util.zip.Deflater.(Unknown Source) at java.util.zip.Deflater.(Unknown Source) at com.aspose.pdf.internal.l6n.lI.lI(Unknown Source) at com.aspose.pdf.ContentsAppender.updateData(Unknown Source) at com.aspose.pdf.Stamp.lI(Unknown Source) at com.aspose.pdf.TextStamp.put(Unknown Source) at com.aspose.pdf.Page.addStamp(Unknown Source)

Could you please suggest fix for this Issue. We tried increasing Max Heap size of tomcat to 1900mb but still seeing this Issue.

Thanks,
Karthik

Please Note that we tried using Latest Version aspose.pdf-21.8.jar.

Thanks
Karthik

@karthik13

Could you please share complete sample code snippet or a console application with sample file(s)? We will try to replicate the issue in our environment and address it accordingly.