Memory usage problem

Hi, After using aspose conversion from pdf to html for java, the memory usage on tomcat server never goes down again and my application cannot render additional documents anymore.

is there a way to reduce memory usage after making conversion with aspose.


With regards,
Kyaw Min Htut
Solution Specialist

Hi Kyaw Min,

Thanks for contacting support and sorry for the delayed response.

We have made some improvements related to memory management in recent release versions but in order for us to specifically test the scenario/issue which you are facing, please share some details i.e are you facing problem with some specific set of documents or its appearing for all the files. Please share which version of API you are using, the Operating system and JDK version which you are using.

We are sorry for your inconvenience.

PS, you may consider testing the latest release of Aspose.Pdf for Java 10.3.0 and see if it resolves your issue.

Hi Kyaw,

In addition to above reply, you can use MemoryCleaner object to clean the memory. After completing operations with Aspose.Pdf object you can close object with close() or dispose() methods and finally use com.aspose.pdf.MemoryCleaner.clear() method, It clears Aspose.Pdf specific instances and will enables you to effective memory usage.

Please note it is recommended that you should call this method only if there is a shortage of available memory. Please find sample code to check memory status.

Runtime rt = Runtime.getRuntime();
long max = rt.maxMemory()/1048576;
long total = rt.totalMemory()/1048576;
long free = rt.freeMemory()/1048576;
long used = total - free;

Best Regards,