We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How do I limit resource usage while converting to PDF-A?

I use Aspose with Total license in Java project to convert user files (docx, xlsx, pptx, images or other pdf) to PDF-A format.
I call pdfDocument.convert() with option PdfFormat.PDF_A_3B. Generally it works just fine.
But some files contain high resolution images or vector images that take a load of resources (more than 1Gb RAM) to process. Here is an example of such file that is only 2Mb but fails to be converted with resources available:
ec10fe92-2cab-45be-a120-c99af775b556.pdf (1.9 MB)
Also when my app hits memory limit, its Garbage Collector goes crazy and takes all CPU resources available.
Is there a way to limit RAM usage of Aspose PDF converter?
Is there a way to set resolution of converted raster images?
Is there a way to set resolution of converted vector images?
Is there a way to skip vector image conversion at all?


We need to investigate this whole scenario in details so that we can provide some feedback. Could you please share your environment details e.g. OS Name and Version, JDK Version, Installed RAM, Java Heap Size, etc. We will log an investigation ticket and share the ID with you.

Ubuntu 20.04.3 LTS
openjdk 11.0.10 2021-01-19
Aspose version: 21.1
Java heap size: anything less than 1900 Mb (starts to work on java -Xmx2g)
MemTotal: 32697336 kB (32 Gb on system)

Any more details needed?
I may also provide a sample application.


Thanks for sharing the requested information.

We are testing the scenario using 21.9 version of the API in our environment. Meanwhile, you can please also test using the latest version and share the screenshot of CPU/Memory Usage with us in case you still notice any issues.

I changed version to 21.9 but the behavior hasn’t changed. Still it runs on 2Gb of memory and fails on 1.5Gb. Here are screenshots of resources usage and profiler info.

aspose run 1.5g fail.png (198.1 KB)
aspose cpu_mem_charts.png (53.8 KB)
aspose profiler summary.png (232.3 KB)
aspose profiler biggest.png (217.3 KB)


Thanks for sharing the requested information. We were also able to notice this behavior of the API. Therefore, an investigation ticket as PDFJAVA-40943 has been logged in our issue tracking system. We will further look into its details and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.