Very High Memory Consumption

Hello


We currently are using OpenOffice to convert to PDF thousands of documents. We ran into many issue using this approach and we are evaluating your library as a good replacement.

So we tested your library using about 10000 different test documents. While it work correctly most of the time, some of our test documents cause the library to use all the memory (we cannot afford to allow more than 1GB of RAM per process for this JVM). It is mostly document having images. Even if the source document is a few megabyte (13MB) the consumption of memory of Aspose to be able to sucessfully convert it to PDF can eat up to 1.6GB for this perticular document.

From the stack trace, it seems to be related to manipulation of images. Here is an example for a crash for a power point document:
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
at com.aspose.slides.bqu.(Unknown Source)
at com.aspose.slides.bra.do(Unknown Source)
at com.aspose.slides.bqu.do(Unknown Source)
at com.aspose.slides.ImageTransformOperationCollection.do(Unknown Source)
at com.aspose.slides.Picture.do(Unknown Source)
at com.aspose.slides.Picture.do(Unknown Source)
at com.aspose.slides.sq.do(Unknown Source)

Here is an example of such stack trace for a Word document (for the other Aspose product Aspose.Words):

Exception in thread “Image Fetcher 0” Exception in thread “main” java.lang.OutOf
MemoryError: Java heap space
at java.awt.image.DataBufferInt.(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
at sun.awt.image.ImageRepresentation.createBufferedImage(Unknown Source)
at sun.awt.image.ImageRepresentation.setPixels(Unknown Source)
at sun.awt.image.ImageDecoder.setPixels(Unknown Source)
at sun.awt.image.JPEGImageDecoder.sendPixels(Unknown Source)
at sun.awt.image.JPEGImageDecoder.readImage(Native Method)
at sun.awt.image.JPEGImageDecoder.produceImage(Unknown Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.(Unknown Source)
at java.awt.image.Raster.createPackedRaster(Unknown Source)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknow
n Source)
at java.awt.image.BufferedImage.(Unknown Source)
at asposewobfuscated.zzQ5.zzZ(Unknown Source)
at asposewobfuscated.zzQ5.zzZ(Unknown Source)
at asposewobfuscated.zzQ5.zzZ(Unknown Source)


The same document converted loaded in OpenOffice will use a fraction of the memory the Aspose library require to convert it, wich is kind of a show stopper for us.

For the “Aspose.Cells” there are memory tweaks but we have not found such tweaks for Aspose.Slides.  It is very important for us that the library is able to convert document using a much smaller memory footprint (using disk cache if required).

Alternatively would it be possible to only convert one Slide at a time and flush is to disk wichout eating up all the memory ?

I can send the related documents that requires high memory to convert and source code as well.  I would prefer not sharing them on the forum though.

Regards

Hi Nick,


Thanks for your interest in Aspose.Slides.

I have observed the performance requirements shared by you and like to share that whenever the presentation is loaded in Document Object Model (DOM) of Aspose.Slides, it certainly consumes more memory than size of presentation on disk as it’s going to fill the data structure inside DOM. The more are the number of slides and shapes on them, the more memory it will consume in memory to load that. Also, if the slides have multimedia contents like images, videos or audios, it exponentially eats up the memory. So, the amount of memory consumed varies from presentation to presentation. Also, when you render such presentation to PDF or generate the images, it takes additional memory.

As per your statistics shared for Aspose.Words and Aspose.Cells, and their comparison made with performance of Aspose.Slides, I like to share that we are working in direction of improving rendering performance of Aspose.Slides on our end. What, I request you at the moment is to share the comparison of your target presentation with Aspose.Slides and Office component used on your end. Please share the time statistics, machine details and source presentation used in both Aspose.Slides and your Office component. I will add a performance ticket in our issue tracking system to further investigate and resolve the issue.

Many Thanks,

Are there any news on this issue? I am experiencing the same problems when converting presentations containing images and video files.

Hi Marco,

I have observed the comments shared by you and request you to please try using Aspose.Slides for Java 15.4.0 on your end first. If you still feel the performance related issue then please share the sample presentation, sample code, machine statistics, environment statics with us in separate thread. I will investigate the issue further on my end to help you out.

Please also share the statistics achieved on your end as well.

Many Thanks,