OutOfMemory while working on Linux environment

Hello.
We are experiencing the OOM issue while working with following code under RedHat Linux.
We don’t have it on Windows environments.

public async Task<(string bigImageName, string thumbnailName)> GenerateImagesFromFirstPdfPage(byte[] fileBytes)
{
await using var ms = new MemoryStream(fileBytes)
{
Position = 0
};

        using var pdfDocument = new Document(ms);
        using (var imageStream = new MemoryStream())
        {

            var resolution = new Resolution(300);
            var jpegDevice = new JpegDevice(resolution, 100);

/* IS FAILING HERE — > */ jpegDevice.Process(pdfDocument.Pages[1], imageStream);

Steps we tried to fix the issue:

  1. Update Aspose to 21.9.0.
  2. Set the application to x64 architecture platform.
  3. Update libgdiplus package on RedHat Linux.
  4. Set folder with msttcorefonts.

Call Stack:
Out of memory. | System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.get_ClipBounds() at #=znOBlVFEgY6T8Vnl8n5E$Tho74525JAcrCrjZ7R4=.#=zRGjzHwWMZSZL(#=zxV9nq7RWlNiju81qwemJn5pMErBg$fkxlw== #=z5ADTlYA=) at #=zmrx0$ubGDtAlE70HNdTzzQ1b_0A6pbfbaKdBYAa7bdXQvqIpQw==.#=zD2N$JNjCwudV(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=zcXapwFY=) at #=z8ji8PcCb1ywUbV4y6UiEKmFrVrzJ73z46W6_SW6E6all.#=z5WmVXyr4TfST(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=zcXapwFY=) at #=z8ji8PcCb1ywUbV4y6UiEKmFrVrzJ73z46W6_SW6E6all.#=zBQ9g8p0=(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=zcXapwFY=) at #=zqw9ISzvB3tQKO7TL$dspb_G5E4t2oHHdm5IFofc9mSqI.#=zxAjpm_RDY73u(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5 #=zcXapwFY=, List`1 #=zCokaWvIKEMcr) at #=zqw9ISzvB3tQKO7TL$dspb_G5E4t2oHHdm5IFofc9mSqI.#=zn1BeGyU=(#=zrCfidmrECsBZt_d02cEc$ACjxxMQ #=z80BbSX4=, #=zUCCFEnc8iGlSEATxRvUz6Wc1TWU0bVIEPQ== #=zfvoEoF8=, #=zOP_Ak16tzu8wDVHuiFEXdIJRlNJmMpuivShlIp0= #=zUOMCWlc=, #=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5& #=zcXapwFY=) at #=z1CZaqk5CivJdo1AWQYb_mYd59YSM.#=zNN4Iy3U=(#=zRMjdLi$0x6oAw08qE5aSmPxnXRDPx5AoGtcGwE31DZU5& #=zcXapwFY=) at #=z1CZaqk5CivJdo1AWQYb_mYd59YSM.#=zNN4Iy3U=() at Aspose.Pdf.Devices.ImageDevice.#=zNN4Iy3U=(Page #=zfvoEoF8=) at Aspose.Pdf.Devices.JpegDevice.Process(Page page, Stream output)

Thanks in advance.

@DSDeveloper

Would you please share your sample PDF document for our reference so that we can test the scenario in our environment and address it accordingly?

Yes, it is attached. 36744821-b385-46a6-ac82-18cb55dae54a.pdf (1.8 MB)

@DSDeveloper

We have logged an investigation ticket as PDFNET-50749 in our issue management system for this case. We will further look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

@asad.ali Is any updates on PDFNET-50749 ?
thanks!

@DatassentialAP

Regretfully, the earlier logged ticket has not been yet resolved due to other issues in the queue. Nevertheless, we will surely inform you once we have some updates about ticket resolution. Please spare us some time.

We are sorry for the inconvenience.

I also have a problem on ECS where I am getting an OutOfMemory issue when downloading a large PDF or multiple PDF’s. The box is also Linux based with 1 CPU and 4GB ram.

Like @DSDeveloper mentioned above we also have a memory issue where the machine stops unexpectedly. The issue does not happen on Windows.

We also have had to install the libs as @DSDeveloper mentioned.

We are using a USING block in C# in Asposes generation part therefore it should technically handle garbage collection in memory properly.

@usmanpop

The information and concerns shared by you have been recorded under the ticket and we will surely consider them during investigation. You will be notified as soon as we make some progress towards issue fix. Please spare us some time.

We are sorry for the inconvenience.