Hello,
We are converting Tiff images to pdf using Aspose PDF Java 21.5 and noticed that there appears to be a memory leak because we get an out of memory exception. If I run the follow code snippet below with a tiff images 1000 times to simulate a 1,000 page document it runs out of memory.
BufferedImage image = ImageIO.read(new File(inputFilePath));
boolean rotateToLandscape = image.getWidth() > image.getHeight();
Document doc = new Document();
Page page = doc.getPages().add();
if (rotateToLandscape) {
page.getPageInfo().setLandscape(true);
}
com.aspose.pdf.Image image1 = new com.aspose.pdf.Image();
image1.setBufferedImage(image);
page.getParagraphs().add(image1);
page.getPageInfo().getMargin().setBottom(0);
page.getPageInfo().getMargin().setTop(0);
page.getPageInfo().getMargin().setLeft(0);
page.getPageInfo().getMargin().setRight(0);
doc.save(outputFilePath);
Error: java.lang.OutOfMemoryError: Java heap space