Hello, I am in the latest version of aspose A bug was found in slides. My client is using aspose When slides are watermarked, there is an out of memory error. The error is thrown during new representation. There is no problem with the old version of Aspose slides. Please help solve it. The attachment is the problem file.
My environment is Ubuntu, docker container NetCore3.1,aspose. slides. Net version number: 22.6
full stack trace of the error: Aspose.Slides.PptxReadException: Out of memory. —> System.OutOfMemoryException: Out of memory. at System.Drawing.SafeNativeMethods.Gdip.CheckStatus(Int32 status) at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap…ctor(Int32 width, Int32 height) at Aspose.Slides.ImageCollection.(e , Size ) at Aspose.Slides.ImageCollection.(ISvgImage , Single , Single , Boolean& ) at Aspose.Slides.ImageCollection.(ISvgImage ) at Aspose.Slides.ImageCollection.AddImage(ISvgImage svgImage) at .(ISlidesPicture , , e ) at .(ISlidesPicture , , e ) at .(ISlidesPicture , e , e ) at .(PictureFillFormat , e , e ) at .(IPictureFrame , , e ) at e.( , IGroupShape , e ) at e.(IGroupShape , , e ) at .(IBaseSlide , e , e ) at .(Slide ) at .(IPresentation ) at e.( , IPresentation ) at e.(Presentation , Stream , InterruptionToken ) — End of inner exception stack trace —
@rainwzy,
Thank you for the additional information. I’ve reproduced the problem with loading the prsentation and added a ticket with ID SLIDESNET-43334 to our issue tracking system. We apologize for any inconvenience. Our development team will investigate the case. You will be notified when the issue is resolved.
Has the problem of memory not releasing been solved? I downloaded the 52kb file I provided above 100 times, and the memory increased by nearly 1g. If the file itself is larger, the memory will increase more, and the memory will not be released
using (presentation presentation = new presentation (filepath)) {}
without any operation on the presentation object. I have a 34m file. I only need to instantiate it once, and the container memory will increase by more than 1G, but I can’t upload it. You limit the size of uploaded attachments
@rainwzy,
Unfortunately, your code example does not show the measurement approach. I’ve used the following code example to measure memory consumption with the presentation file shared above and Aspose.Slides 22.7:
var before = Process.GetCurrentProcess().VirtualMemorySize64;
for (int i = 0; i < 100; i++)
{
using (var presentation = new Presentation("123.pptx")) { }
}
var after = Process.GetCurrentProcess().VirtualMemorySize64;
var result = after - before;
Console.WriteLine(result + " bytes");
My current output is 290 856 960 bytes on Ubuntu 18.04. Please check your results using the version 22.7.
You can share a link to the file saved in a file storage (Google Drive or Dropbox, for example).
@rainwzy,
Thank you for the dockerfile. I’ve added a ticket with ID SLIDESNET-43391 to our issue tracking system. Our development team will investigate the case. We will inform you of any progress.
Can the memory not be released in the next version?
In addition, before you tested the system with no memory problem, what base package system did you use, not Debian? Can you show your dockerfile? I used your dockerfile to test whether there was a problem
The issues you have found earlier (filed as SLIDESNET-43334) have been fixed in Aspose.Slides for .NET 22.8 (ZIP, MSI).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.