Memory utilisation for large number of slides

Hi,

Version : Aspose Slides for Java 17.10.0.

We use the above version and need some clarification around how Aspose API utilises memory when adding a large number of slides. We have requirements to support PowerPoint (PPTX) of 100+ slides. Majority of these slides will contain either a PPT chart object or an image. How does Aspose manage writing of large slides. Does it use memory or does it utilise disk space for building the slides?

Thanks

@ApiDeveloper,

I have observed your comments regarding PowerPoint presentation and Aspose.Slides. I like to add here that you are using PPTX which is compressed XML format. So the presentation gets extracted in memory when you load the compressed XML in Document Object Model of Aspose.Slides where by every single property gets sets for presentation content. The amount of memory consumed is dependent upon size of presentation, number of slides, contents inside slide and embedded components inside slides. Especially, if there are tables and charts involved, they eat up a lot of memory space when loaded in DOM.

So, the Optimal memory requirement is directly linked with the above parameters shared and it varies from presentation to presentation. Generally on my machine, I use 1 GB heap size for normal presentation files for rendering. I request you to please try using x64 assembly of Aspose.Slides for .NET in your application with x64 application. This will give you enhanced program memory in your case to avoid OutofMemory exception.

Thanks Adnan. We use Aspose Slides for Java not .Net. So building of a presentation file is all in memory, each slide we add to a Presentation (com.aspose.slides.IPresentation), will be held in memory and it wont use any disk space. Apache POI for excel uses streaming API where in it utilises disk space so that the application does not run out of memory. I was hoping Aspose may be using similar technology so that it does not run out of memory. We run app with 4GB memory, hopefully, the footprint for 100 slides in a Presentation is not massive.

@ApiDeveloper,

I have observed your comments and like to share that when you instantiate Presentation class object to load presentation, complete presentation gets loaded in memory. In future, we are going to provide the support for partially loading the presentation in memory instead of complete one. An issue with ID SLIDESJAVA-35052 has already been created in our issue tracking system as new feature request to provide this support. We will share the good news with you as soon as the feature will be available in API.

Thanks @mudassir.fayyaz. My query was more to do with creation of presentation rather than reading a presentation. My concern is around memory utilisation during creation of a presentation. For e.g. if I have 100 images of 2MB each. When I want to create a presentation with each image on a separate slide, that will give me nearly a 200MB file. Is this creation of file all in memory? It will be nice if disk space can be utilised rather than memory.

@ApiDeveloper,

I have observed further comments from your and like to share that the entire presentation gets loaded in memory and during thumbnail or image generation process the image rendering takes places completely in memory till the time it is saved finally on disk. Once it is saved on disk the concerned memory is relieved. I hope the shared elaboration will be helpful.

Thanks @mudassir.fayyaz. The images I was talking about are externally created. The task here is to create a presentation with these images, each image on a different slide. So I assume from your description it is all in memory. So if I have each image on an average size of 10MB, there are such 100 images. A presentation of 100 slides will take approx 1GB to build in memory. It will use up JVM heap of 1GB for creating this presentation of 100 slides with 1 unique image of 10MB on each slide. Are you able to confirm this with the development team?

Thanks

@ApiDeveloper,

I have observed your comments. Actually, when you add the image inside slide, that gets added in presentation image collection first. So, any image added inside images collection will increase occupied memory size for presentation. However, if you try to add the same image again inside presentation, Aspose.Slides takes care of that automatically and no duplicate image gets added in presentation. I hope the shared elaboration shall be helpful.

Thanks. As mentioned its not a duplicate image (unique images).

@ApiDeveloper,

Please refer to first part of my last response in my previous response which addresses your answer.

Yes thanks got it.