Free Support Forum - aspose.com

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);
    StreamSupport.stream(presentation.getSlides().spliterator(), false)
        .map(Main::getImage)
        .forEach(Main::consumer);
  } catch (IOException e) {
    e.printStackTrace();
  } finally {
    if (presentation != null) {
      presentation.dispose();
    }
  }
}

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));
}

@PROCUREMENT2

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.

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

@PROCUREMENT2

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

@mudassir.fayyaz
Let’s close this ticket.

@PROCUREMENT2

Thank you for sharing the feedback.