Hi!
In our web application we encountered with very strange growing of used memory when use aspose-pdf for java classes (aspose-pdf-4.1.2). Users of application manipulate pdf files in very aggressive manner, but use case is rather simple - just put and remove images on first page of pdf document. Free memory on server finishes rather quickly and application crashes with OutOfMemory error. We’ve got such troubles right after we added this functionality to the server side code.
In attached file I put simple console application(project for Intellij IDEA) which illustrates our approach to place and remove images. Also there is already compiled application in the “distr” folder of project with sample pdf and image files. Just run “java -jar testpdf.jar” and in the “output” folder there will be pdf files we need.
Also I attached two JProfiler reports - one with no any aspose-pdf calls (just message dialog) - for “calibration” purposes to see how simple application work. And the other one is result of 2 pdf files processing.
I realize that our code can be far from ideal, so any workarounds or suggestions how to improve our approach(and still get desired result) are welcome.
I really appreciate any help you can provide.