Thanks for your inquiry.
Generally it is good practice to dispose an object after it is no longer needed and in case that object uses some resources and they are not being disposed with that object, this leads to memory leaks.
In Aspose.Pdf DOM model,
Document.Save(...) method is more like disposing the object itself as well as other resources which were being used by it. In DOM model, you work with a complete document object which contains full hierarchy of classes and it uses many unmanaged resources, so as I said earlier that if resources used by an object, are not disposed with it, it may lead to memory leaks. Which is why this new feature of disposing object with save method was implemented in the API.
Since, you are not disposing object in your code snippet, neither you are using
Save(...) method, so it is advisable to dispose the object at the end of its usage. However, you may use try-finally approach (just like using statement in C#.NET) and make sure that all objects are disposed after they are no longer of use.
We have tested the scenario in an environment i.e Ubuntu 15.04, Spring-Boot Application, Maven Build, JDK 1.8 and Aspose.Pdf 17.10 for Java. We were unable to reproduce the OOM exception at our side. It will really be appreciated, if you can please share a sample application, which generates the exception at your end. It will help us in replicating the issue in our environment and address it accordingly.
Please also note that, it is always recommended to use latest version of the API as it contains more fixes and performance improvements. You may also try your scenario with latest version of the API and let us know about the results at your end.
Now concerning to the Aspose.Slides related issue, we are working over testing the scenario and will let you know about our findings as soon as possible. Please spare us little time.
We are sorry for the inconvenience.