Memory Leak when using multiple aspose-pdf features in t3.2xlarge EC2 Instance with Docker

Hello team,
We’re facing memory leaks while doing the following with aspose-pdf on Java 8 in a Linux Docker Container (in t3.2xlarge EC2 Instance on AWS):

  1. PDF files are being stitched together to form one PDF file of size ~200MB
  2. HTML File is converted to PDF and added to this
  3. Bookmarks are added to the PDF
  4. Navigation to the linked pdfs is created using: LinkAnnotation
  5. Page Numbers are associated using: TextStamp

We’re seeing that over time the memory consumed by this process doesn’t go down - even with no load on the system, indicating a memory leak. When this exceeds the memory allocated to the docker container it goes down, bringing our process to a halt, and creating a new container - this is not ideal for our production evironment.
We’re seeing when we take a Heap Dump that the possible memory leak culprits are all tying down to aspose pdf internal.

The min and max heap size here is 20 GB.

Could you please assist with the same?

@j.aditya

Can you please share a sample code snippet or sample application that can reproduce the similar behavior in our environment? We will surely test the scenario in our environment and address it accordingly.