Memory leaks in Aspose PDF NET

We have a following lines of code to check the memory usage and dispose in Aspose PDF NET 22.3.0

string[] _pdfFiles = new string[] {
        "Data/sample_45_mb.pdf",
        "Data/Nikon16mb.pdf",
        "Data/24mb.pdf",
         "Data/sample_45_mb.pdf",
        "Data/Nikon16mb.pdf",
        "Data/24mb.pdf",
        "Data/sample_45_mb.pdf",
        "Data/Nikon16mb.pdf",
        "Data/24mb.pdf",
        "Data/sample_45_mb.pdf"
        };
foreach (var fileName in _pdfFiles)
            {
                using (var file = File.OpenRead(fileName))
                {
                    using (Document document = new Document(file))
                    {
                        using (MemoryStream textStream = new MemoryStream())
                        {
                            Aspose.Pdf.Devices.TextDevice textDevice = new Aspose.Pdf.Devices.TextDevice();

                            Aspose.Pdf.Text.TextExtractionOptions textExtOptions = new
                             Aspose.Pdf.Text.TextExtractionOptions(Aspose.Pdf.Text.TextExtractionOptions.TextFormattingMode.Raw);
                            textDevice.ExtractionOptions = textExtOptions;
                            textDevice.Process(document.Pages[1], textStream);
                            string extractedText = Encoding.Unicode.GetString(textStream.ToArray());
                        }
                    }

                }
            }

We are observing the the Aspose is not disposing memory even after completion of the execution of above code (foreach loop).

Ex: In Performance profiler we saw the Aspose is still using 200+ MB of memory after this code execution.

Link for the above files

Any suggestions much appreciated.

@cpaperless

When PDF document is closed, all the DOM data is purged from memory during the next garbage collector cycle. Please note that the memory may not be released until you close the application.

Could you please share all steps how are you checking the memory leakage?

Please find the VS performance profiler output file
You can view this in VS 2019 or above.
This is the output of the above code in terms of memory usage and dispose.

ReportAsposeMemoryLeak.zip (1.6 MB)

@cpaperless

We have logged this problem in our issue tracking system as PDFNET-51685. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@tahir.manzoor is this issue fixed ?

@procurement-opp_allianz_de

We are afraid that the earlier logged ticket could not get resolved yet due to the other pending issues in the queue. We will surely inform you as soon as we make some progress towards ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

6 posts were split to a new topic: document.Convert() CONSUMES HUGE MEMORY

3 posts were split to a new topic: Aspose.PDF (21.4 versus 24.2) shows peak usage of 2.1GB and 5.6GB respectively

@ST2YKE2

Can you please share if @pjjonah66 is also part of your team/organization?