We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Memory leak in Aspose.PDF?

When converting from Image to PDF using Aspose.PDF, there seems to be a memory leak when using RgbToDeviceGrayConversionStrategy()

I have proviced a code example below:

Private Sub ConvertToGreyscale(ByRef doc As AP.Document)
        
    Dim strategy = New Aspose.Pdf.RgbToDeviceGrayConversionStrategy()

    For Each page In doc.Pages
        strategy.Convert(page)
    Next
        
End Sub

This was also present in version 19.4, and upgrading to 19.9 hasn’t solved the issue. Could you please look in to this.

@philipcrossland

Thank you for contacting support.

Would you please elaborate if you notice this problem with specific PDF document or with every document. Kindly share a sample document so that we may proceed to reproduce and investigate further.

Hi, it is any document that is converted from TIF to PDF, and then converted to greyscale using the RgbToDeviceGrayConversionStrategy function

@philipcrossland

Thank you for the information.

We need a document from your side. Please share a sample file so that we may proceed further.

TestTifFile.zip (88.5 KB)
Hi, please see the attached tif file. I have to add it to a zip file to be able to upload.

@philipcrossland

Thanks for sharing the TIFF file.

Would you kindly elaborate further of memory leak as we tested the scenario in our environment and were unable to notice any issue with Aspose.PDF for .NET 19.9. Attached is the final output that we produced in our environment. OUTPUT.pdf (287.5 KB)

Would you kindly share some screenshot or sample project with us which is able to replicate the issue that you are facing. We will further proceed to assist you accordingly.

ConsoleApp5.zip (104.2 KB)
Hi, I have attached a sample c# project which loops through the conversion. If you monitor the memory usage by the app you can see it keeps increasing over time.
The license file path in the app.config will need changing, and the nuget package will need to be restored before running the app.

@philipcrossland

Thanks for sharing a sample project.

We were able to notice that memory consumption kept increasing while calling API methods inside loop. We have logged an issue as PDFNET-47070 in our issue tracking system for the sake of correction. We will further look into this and keep you posted with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.

Hello Asad.Ali.
We’re having the same issue with the .NET Aspose.Pdf.RgbToDeviceGrayConversionStrategy().
When placed inside a loop to process several PDFs, we notice that processing time increases exponentially after each file even when all the files are the same size.
Did you have a fix for PDFNET-47070 ?

Thank you.

@meyergio

We are afraid that the earlier logged ticket has not been yet resolved. However, we have recorded your concerns and will surely inform you as soon as we have some certain news about its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.