Memory Leak when using Dispose method on object

When using Aspose.Slides if our code loads a file (example attached), we see the memory usage shoot up and not get released even if the Dispose method is called. However if another, smaller file is instantiated in the same session of the application, the original memory is released.

var p = new Aspose.Slides.Pptx.PresentationEx(path, new Aspose.Slides.LoadOptions()); p.Dispose();
p = null;

Hi Stacey,

I have worked with the presentation file shared by you and have been able to observe the issue specified. I have created an issue with ID SLIDESNET-35212 as investigation in our issue tracking system to further investigate and resolve it. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

It has been two years!


Why does Aspose NOT solve these issue in a timely manner?
I am getting sick and tired of posting issues that NEVER GET Fixed.

Hi Roj,

I have observed your comments. We are very sorry about issue you are facing, Please accept our apology. I have requested our product team to investigate issue in details. We will update you soon regarding this issue.

We are sorry for your inconvenience,


Yo said you will look into this 2 years ago and I see no fix posted not even a follow up of status.

How can you sell a product that doesn’t fix bugs for two years. I need the memory leak issue fixed immediately.

When is it scheduled to be fixed?


Hi Roj,

We are sorry for your inconvenience. Actually, the issue did not get schedule as it was added for the product that is no longer supported. We infact moved to new merged Aspose.Slides for .NET Api after your reporting. The new API has only one namespace for dealing with both PPT and PPTX presentations and we have Presentation class in new API to work with presentation as again PresentationEx that has been earlier reported by you.

The issue has been scheduled for investigation in coming week and in mean time, I also suggest you to please try using our latest Aspose.Slides for .NET 16.12.0 API that has many new features and is a much stable version.

Best Regards,


We tested our issue using your Aspose.Slides for .NET 16.12.0 API trial and this release DOES NOT FIX the memory release issue.

As you can see at the picture, 6 presentation objects (800 mb each) were instantiated, but after using of this objects memory was NOT released, even after the force call of garbage collector.

What day next week?
Unable to attache image. Please allow me to attach images for clarification.

Hi Roj,

This issue will be investigated as soon as possible in coming week. We have also raised issue priority from low to high priority. I request for your patience until issue is investigated.

We are sorry for your inconvenience,

Hi Roj / Muhammad;

I am evaluating this product. I wanted to know whether this issue is fixed or not yet?

My main aim is to merge 10-20 fields each having 2 to 5 slides. I am facing out of memory issue after merging 50-70 slides even after setting 4gb of memory. Total size of files being merged is around 3MB but during merging JVM occupies all specified memory after merging few slides and it goes out of memory after around 70 slides.

I am attaching the sample code and output as well. If possible, please look into it and suggest solution if any. For your information, I’m using the latest version of Aspose slides for Java . version 19.9 (3.5 KB)


I have observed your sample code and like to share that when you are merging this big number of presentations decks and especially destination presentation size growing on each cloning instance. The DOM of presentation is loaded in memory and it consumes memory. The amount of memory required is directly dependent on size of presentation, number of slides, content inside slide especially multimedia content. Slide cloning/merging process has requirement of large memory which is dependent of presentation decks you are working over. I suggest you to please consider increasing heap size further to match level of your presentation decks. A possible tweak that you may try in your code is to dispose the loaded presentation in your for loop that you are merging on your end.

Hi Thanks for your reply.

I have allocated 4GB of memory to merge only 20 files. Each slide contains some data in tabular format. Some of these slides contains charts. No heavy graphics. Total file size is not exceeding 3 MB.

Please note that I have used “dispose()” method for source and destination also. I found no difference with and without using dispose method. The program goes out of memory beyond 80-90 slides.

During production use, the container will always have more memory but if merging process will occupy them all then it will affect other processes and overall performance will degrade. I don’t want to do that.

Is there any solution to merge few files without consuming this much amount of memory? You have provided method to clone slides. Is there any other alternative to append presentation files directly instead of slides without consuming this much amount of memory?


Can you please share source file along with complete sample project to reproduce issue so that we may further investigate to help you out.

A post was split to a new topic: Memory Leak when Using Dispose Method on Presentation Object in C#