High Memory Usage when Generating Large PDF with Images using Aspose.PDF for .NET (v25.4.0, .NET 8.0)

We are using Aspose.PDF for .NET (v25.4.0) in a .NET 8.0 application to generate large PDF reports that contain a significant number of images (400+), along with text content.

While generating the report, we observed that the memory usage grows beyond 2 GB. To optimize, we attempted splitting the report into multiple section-wise PDF files and then merging them into a final single PDF. However, even after explicitly disposing the objects after each section PDF creation, the memory usage does not reduce.

This leads to continuous high memory consumption (>2 GB), eventually causing performance degradation and risks of hitting memory limits.

Expectation:

  • Memory usage should be released after disposing intermediate PDF documents during section-wise generation.
  • The overall process should allow generating large reports without excessive memory consumption.

Issue:

  • Memory remains consistently high even after disposing section-level PDF objects.
  • This behavior prevents efficient handling of large reports.

Environment Details:

  • Aspose.PDF for .NET: 25.4.0
  • .NET Core: 8.0
  • Content: ~400+ images + text

Request:
Could you please advise on:

  1. Whether this is a known memory management issue with Aspose.PDF.
  2. Recommended best practices for handling large PDF generation with many images.
  3. Any configuration, API usage patterns, or workarounds to ensure memory is released properly after disposing intermediate documents.

This Topic is created by vladimir.litvinchik using Email to Topic tool.

@koc-it-support

First of all, we request that you please try with the latest available version i.e. 25.8 and see if there are any improvements. In case you still notice these issues, we request that you please share a sample console application along with sample file(s) that we can use to test and reproduce same scenario in our environment. We will surely investigate and address the issue accordingly.