OutOfMemoryException when Creating a Scaled Thumbnail from a Slide in Java

Hi - we are getting an OutOfMemory issue when creating a scaled thumbnail from a slide. We are using aspose-slides v23.5
Here is a demo call that ends up in the issue. The function slide.getThumbnail() is working fine, however as we add scales slide.getThumbnail(scale, scale) we get an OOM error.
Attached you’ll find the slide and the java file as a zip.

Any ideas? Thanks!

package org.example;

import com.aspose.slides.ISlide;
import com.aspose.slides.Presentation;
import javax.imageio.ImageIO;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class Main {
    public static void main(String[] args) throws IOException {
        System.out.println("Hello world!");

        Presentation pres = new Presentation("DimNio30_2.pptx");
        try {
            ISlide slide = pres.getSlides().get_Item(0);
            float scale = 1.4f;
            // generate Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
            BufferedImage image = slide.getThumbnail(scale, scale);

            // works
            //BufferedImage image = slide.getThumbnail();

            ImageIO.write(image, "jpeg", new File("testimage.jpg"));

        } finally {
            if (pres != null) pres.dispose();


OOM-issue-slides.zip (42.7 KB)


Thanks for the PowerPoint presentation.

I reproduced the issue using your sample file and code snippet. I found OutOfMemory issue when creating a scaled thumbnail from a slide as you pointed out. We will log a ticket for it and will be looking into it soon.

1 Like


We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39212

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.


We are pleased to inform you that your issue (logged as “SLIDESJAVA-39212”) has been resolved. The fix will be included in the next release (Aspose.Slides v23.6) which is scheduled in this month. You will be notified when the next version is released.

Hi @amjad.sahi - thanks for your response and your effort.
Any idea on when exactly v23.6 will be released?


Probably in the last week of the month but we are not sure about it. Please note, releases are published once ready, so there is no concrete date for it.

1 Like

The issues you found earlier (filed as SLIDESJAVA-39212) have been fixed in Aspose.Slides for Java 23.6 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.