OutOfMemoryError when Reading a 97-2003 PowerPoint Presentation in Java

We have a handful of quite small PowerPoint presentations that cause OutOfMemoryError exceptions when we try to read them using any version of Aspose Slides (Java), including 20.10. The partial stacktrace we see is as follows:

Caused by: java.lang.OutOfMemoryError: Java heap space
	at java.util.Arrays.copyOf(Arrays.java:3689) ~[?:?]
	at com.aspose.slides.Collections.Generic.List.setCapacity(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Collections.Generic.List.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Collections.Generic.List.addItem(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.internal.da.do.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.internal.da.try.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.internal.da.goto.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.internal.da.goto.<init>(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.ae5.if(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Presentation.do(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Presentation.if(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Presentation.<init>(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]
	at com.aspose.slides.Presentation.<init>(Unknown Source) ~[aspose-slides-20.10-jdk16.jar:20.10]

Presently, we don’t have permission to share the Powerpoint files on this ticket - but we’re trying to obtain permission. While we wait for permission, is there some option or configuration parameter we can use with Aspose Slides that will yield more verbose logging or diagnostics?

@nuix

Can you please try increasing the Java Heap size on your end and share the feedback with us if there is still an issue.

Hi, I forgot to mention in my original post that we had increased the heap to well over 20GB and still experience the OOM exception. I imagine 20GB of heap should be more than adequate given the PowerPoint file under consideration is approx. 980KB.

@nuix

Please share the working sample project with us reproducing the issue on your end along with source file, operating system details, Java details and used sample code.

As mentioned above, we’re working on getting permission for the source file. But while we wait for permission: is there some option or configuration parameter we can use with Aspose Slides that will yield more verbose logging or diagnostics?

@nuix

There is no such configuration available for Aspose.Slides. Generally, if there is OOM exception, we suggest to increase the Heap size and it works. However. this seems to be failing on your end.

It is clearly a bug within Aspose, as libraries like Apache POI do not generate an OOM - especially considering the input document is less than 1MB in size. I’m really surprised you have no debug/tracing logs available. Are you 100% sure?

@nuix

Unfortunately, there is no such provision in API at the moment. If you provide us the environment details and source presentation along with used code, we may try to reproduce and investigate the issue on our end.