Memory Usage while Generating Large Files and Saving as PDF in Python

We use slides in our Django application to take a template pptx, insert text and clone slides if needed, and save the resulting Presentation object as a PDF. In some instances, this results in files as large as 300 pages. However, during the save operation, we are noticing jumps in memory usage of around 2 - 2.5 GB, which is becoming a bottleneck for other processes in the container. Is there a work around to optimise and reduce this? I have attached a snippet of the output from memory profiler here.
aspose-memory-usage.png (23.0 KB)

@Consark,
Thank you for describing the issue. We are sorry that you encountered this problem. Please share the following additional information:

  • OS version on which the PPTX to PDF conversion was performed
  • Python version you are using
  • Aspose.Slides version