Aspose.Slides Causes Memory Leak when Doing "renderToGraphics" in Java

Problem file: oom.zip (43.7 KB)

Code:

Presentation deck = new Presentation(input);

NotesCommentsLayoutingOptions options = new NotesCommentsLayoutingOptions();
options.setNotesPosition(NotesPositions.None);

deck.getSlides().iterator().forEachRemaining(slide -> {
  BufferedImage image = new BufferedImage(500, 250, BufferedImage.TYPE_3BYTE_BGR);
  Graphics2D graphics = image.createGraphics();
  slide.renderToGraphics(options, graphics, 500 / (float)deck.getSlideSize().getSize().getWidth());
});

Run the code above – the application will continue to run and use more memory until it dies from memory exhaustion.

System information:

Oracle JDK : 1.8.0_201
Aspose.Slides : com.aspose:aspose-slides:19.1:jdk16

@rocketraman,

I have observed your comments. Can you please try to use Aspose.Slides latest version 19.1 and if there is still an issue than please share complete code snippet. The code snippet you have shared includes some undeclared variables so would you please share SSCCE code reproducing the issue so that we may try to reproduce and investigate it in our environment.

@Adnan.Ahmad Apologies, I have corrected the code sample (just a misdeclared variable due to a copy-paste error), and tried it with Aspose 19.1, with the same issue. I have updated the original post.

@rocketraman,

I have observed the issue shared by you and an issue with ID SLIDESJAVA-37562 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

1 Like

The issues you have found earlier (filed as SLIDESJAVA-37562) have been fixed in this update.