Memory is not removed from Heap properly

I am extracting PPTX presentation to separate images.
After the extraction, Java Heap is not cleared properly and many objects are still left.

What are we missing here?

Screenshot from 2020-12-10 10-57-40.png (131.7 KB)

Dummy implementation of a logic:

public static void main(String[] args) {
  String path = ""; // your path
  Presentation presentation = null;

  try (InputStream is = new FileInputStream(path)) {
    presentation = new Presentation(is);, false)
  } catch (IOException e) {
  } finally {
    if (presentation != null) {

private static void consumer(BufferedImage img) {
  // initial logic
  //ImageIO.write(img, IMG_EXTENSION, slideImage);
  // more other logic

private static BufferedImage getImage(ISlide slide) {
  return slide.getThumbnail(new Dimension(960, 720));


Can you please share the Java details on your end along with which product version you are using on your end. If you are using and older version then please try using latest Aspose.Slides for Java 20.11 on your end.

Java 11 (openjdk 11.0.2)
Aspose.Slides 20.11 (updated from 20.07 today but problem still exist)


Please share the source file with us so that I may log the issue in our issue tracking system for investigation.

Let’s close this ticket.


Thank you for sharing the feedback.