HIgh CPU usage when use a powerpoint with GIF

Hi,
I have a slide with a GIF in it. When I try to use it in aspose it gives a huge CPU hike and crashes in my AWS instance. And gives the following error

java.lang.OutOfMemoryError: Java heap space

In my Laptop it works fine though

The error occurs in the following line

`com.aspose.slides.Presentation presentation = new com.aspose.slides.Presentation(docStreamPptx);`

Herewith I have attached the pptx file which gives the error. If you remove the gif from that and run it, it will work fine.Verified Presentation Error Slide.zip (1.5 MB)

@ravindueranga,

I have observed the issue shared by you and have also tested the presentation on my end. Actually, the amount of memory consumed is directly dependent on number of slides, content inside slides and multimedia contents (images, audios, videos) inside slide. You need to increase the Java heap size on your end to avoid this issue. May be on your laptop the default heap size memory is sufficient to render the presentation where as in your deployed environment the allocated heap size is not that much. Please increase the heap size on your end.

I allocated 1GB in my amazon AWS. Still the error occurs.
In my laptop I have the defauld which is 512MB

@ravindueranga,

I have tried setting 1 GB heap size using Aspose.Slides for Java 17.12.1 and tried exporting presentation to PDF. It worked without any issue on my end. I suggest you to please try using the specified version and also little more heap size for AWS and see if things work. Its certainly not API issue but related to heap size.

Did you try that in AWS, Because this is the settings I have in my AWS

Initial JVM heap size: 1024M
JVM command line options: blank
Maximum JVM heap size: 1024M
Maximum JVM permanent generation size: 256M

it still gives me error

@ravinduerangam,

As requested earlier can you please try increasing heap size little further on you AWS and share at which heap size thing work on your end. Please share the information so that I may discuss that with our product team to share possible reason for this.

it works on following configuration,

Initial JVM heap size: 1536m
JVM command line options: blank
Maximum JVM heap size: 1536m
Maximum JVM permanent generation size: 512m

But my problem is why does aspose need such huge heap space. The file size is < 2MB . And has only one slide

@ravindueranga,

I have observed your comments and like to share that if presentation is of 2MB then it doesn’t mean that it shall use 2MB memory when its get loaded using Aspose.Slides. Actually, when you load the presentation using Aspose.Slides, the Document Object Model (DOM) of Aspose.Slides gets loaded. Moreover, all the statics gets loaded in memory as well. On my end the entire process of loading your presentation and exporting that to PDF (that also takes additional memory) consumes around 800 MB memory. I hope the shared elaboration shall be helpful.

Hi mudassir,

How did you check the memory consumption it takes to lead the PDF. Because I want to test the heaviest file we have and find out it’s memory consumption so I can have a value greater than that as my heap memory.
Thanks

@ravindueranga,

I referred to task manager for Java.exe usage of resources. It never crossed 1 GB memory barrier on my VM of Windows 7. You can also try using the sample code given over this web link as well.