Free Support Forum - aspose.com

Memory Usage when adding pages to existing document


#1

Hi

We are building a PDF from a bunch of single page PDFs using:

mainPdf.Pages.Add(singlePagePdf.pages)

We are linking the PDF to a temp file on disk like so:

        using (var fileStream = new FileStream(tempLocalPdfFilename, FileMode.Open, FileAccess.ReadWrite))
        {
            using (var mainPdf = new Document(fileStream))
            {

The memory usage grows and grows and eventually we run out of memory on the 1.5GB instance this runs on, happens for one example around 4000 pages, is there a more memory efficient way to do this or some kind of garbage collection I can call?

Thanks

Simon


#2

@simon.fairey

Thank you for contacting support.

Would you please share sample PDF document by uploading it to Google Drive, Dropbox etc. so that we may try to reproduce and investigate it in our environment. Before sharing requested data, please ensure using Aspose.PDF for .NET 19.1.


#3

Working on an example for this will update when I have one


#4

@simon.fairey

Please take your time and feel free to get back to us anytime the data is ready. We will be more than glad to assist you.