DeleteUnusedLayoutSlidesOnline Method Throws Out of Memory Error

I am using ASPOSE Slides as a container (I am using slides-cloud:24.4) and when I am calling DeleteUnusedLayoutSlidesOnline() method from my C# code I have Aspose.Slides.Cloud.Sdk.ApiException: ‘Out of memory.’ exception. Seems like it does not depend on PC RAM (I have 32 GB).
How I can fix it?
Thanks.

@sivopliasov.roko

The “Out of memory” exception you are encountering when calling the DeleteUnusedLayoutSlidesOnline method may be related to the size of the presentation you are working with, especially if it contains large images or complex elements. Although you have sufficient RAM (32 GB), the memory required to process the presentation can exceed available resources due to how images and other elements are handled in memory.

Here are some steps you can take to potentially resolve this issue:

  1. Optimize Presentation Size: Before calling the DeleteUnusedLayoutSlidesOnline method, try to reduce the size of your presentation. This can include compressing images or removing unnecessary elements.

  2. Increase Memory Allocation: If you are running this in a constrained environment (like a cloud service), ensure that the service has enough memory allocated for processing large presentations.

  3. Load Presentation in Smaller Chunks: If possible, consider breaking down the presentation into smaller parts and processing them individually. This can help manage memory usage more effectively.

  4. Check for Memory Leaks: Ensure that your application is not leaking memory elsewhere, which could contribute to the out-of-memory error.

  5. Update Aspose.Slides: Make sure you are using the latest version of Aspose.Slides, as updates may include performance improvements and bug fixes that could resolve memory issues.

If these suggestions do not resolve the issue, consider reaching out to Aspose support for further assistance, as they may have more specific insights into memory management for the DeleteUnusedLayoutSlidesOnline method.

If you have any additional details about the presentation or the specific context in which the error occurs, please share them for more tailored advice.

@sivopliasov.roko,
Could you please share the presentation file you used? Then we will check the case soon. If the error occurs only in a Docker container, please share the Dockerfile as well.

@andrey.potapov
Here is the presentation file:
Allworth_Slides_Bug_14OCT2024.zip (1,3 МБ)

Thanks

@sivopliasov.roko,
Thank you for the presentation file. I need some time to check the problem. I will get back to you soon.

@sivopliasov.roko,
I used the code example below and the attached presentation file with Aspose.Slides Cloud SDK for .NET 24.4 and didn’t encounter any errors.

using var fileStream = File.OpenRead("Allworth_Slides_Bug_14OCT2024.pptx");
using var resultStream = slidesApi.DeleteUnusedLayoutSlidesOnline(fileStream);

Please try to isolate the problem to find additional conditions to reproduce the error.

@andrey.potapov thanks for your help

I created a clear console application and did same thing:

using Aspose.Slides.Cloud.Sdk;

var api = new SlidesApi(new Configuration
{
    ApiBaseUrl = "http://localhost:8088",
    AuthBaseUrl = "http://localhost:8088",
    AppSid = "MyAppSid",
    AppKey = "MyAppKey "
});

using var stream = File.OpenRead("D:\\Allworth_Slides_Bug_14OCT2024.pptx");
using var deletedLayouts = api.DeleteUnusedLayoutSlidesOnline(stream);

Console.ReadLine();

But I still have the same exception. I using 24.4 version of SDK and 24.4 version of a container as well.
Maybe you have some kind of parameters for starting of container to increase container’s memory (or something like that)? Because I was use this command:

docker run -p 8088:80 -e "LicensePublicKey=keyHere" -e "LicensePrivateKey=privateKeyHere" -e "ClientId=MyAppSid" -e "ClientSecret=MyAppKey " -v "/data:/storage" aspose/slides-cloud:24.4

Thanks

@sivopliasov.roko,
Thank you for the details. No, I didn’t use any additional parameters. Could you please share the simplest project to reproduce the error?

@andrey.potapov here is the my project:
AsposeTest.zip (131,7 КБ)

Thanks

@sivopliasov.roko,
Thank you for the sample project. I need some time to check the problem. I will get back to you soon.