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:
- Update Aspose to 21.9.0.
- Set the application to x64 architecture platform.
- Update libgdiplus package on RedHat Linux.
- 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.