Using Aspose.Slides on Linux Container with .NET Core Does Not Release Memory

@ansamohdsh,
Thank you for the additional information. I’ve forwarded it to our developers. We will continue investigating the case.

Any updates @andrey.potapov

@ansamohdsh,
As far as I can see, our developers are working on the issue. Unfortunately, I don’t have any additional information yet.

@andrey.potapov
Do you have any updates for us now?

@ansamohdsh,
I’ve requested information from our developers for you. We will let you know soon. Thank you for your patience.

@ansamohdsh,
We’ve conducted a series of tests under .NET 7.0 using the presentations (DiagnosticReportExportTemplate.pptx and Sample.Pptx) you provided, and the previously supplied code sample. Unfortunately, the memory leak is not reproduced as a result of the testing. Could you please provide a sample project (code) and a presentation that reproduces the issue?

It was performed 1000 iterations of loading and saving the presentation both in single-threaded and multi-threaded modes. Memory consumption in the multi-threaded mode ranged from 1.7 to 4.5 GB (10 threads were simultaneously loading and saving presentations). During the testing process, memory usage increased very slowly – by +100 MB after every 100 iterations of loading and unloading presentations. However, this issue is also resolved by invoking the garbage collector via GC.Collect, and memory consumption stabilizes, staying in the range of 1.7-4.5 GB without any increases in the upper consumption limit.

Does memory consumption increase steadily over time, and does it eventually consume all available memory, leading to the application crashing due to memory exhaustion?

@andrey.potapov We are working on a POC where we will replicate the issue by showcasing how we create the components in our ppt.
Please allow us few more day and we will get back to you soon.

@ansamohdsh,
Thank you for the message. We will be waiting for your results and feedback.

GeneratePptSlides-31Aug-2023.zip (1.9 MB)
CustomTreeExport_20230831103949.zip (1.4 MB)

I have attached the sample poc and ppt generated from the poc.
We are able to replicate the issue on our side using this poc.
@andrey.potapov
Please use it as reference and call the endpoint multiple times (atleast 20-30 times) and try to replicate the issue at your end on linux.
Here in the poc we are using all the relevant pieces of aspose library classes which we use in our actual project code.

@ansamohdsh,
Thank you for the sample project and presentation files. I’ve forwarded it to our developers.

@andrey.potapov
hope you are doing well.
Please check with the developers and share the updates as soon as possible.

@ansamohdsh,
As far as I can see, our developers will continue working on the issue this week. Unfortunately, I don’t have any additional information yet.

@andrey.potapov please let us know when you have updates from your developers

@ansamohdsh,
I’ve requested information from our developers. We will let you know soon.

@ansamohdsh,
Our developers are currently investigating which operations with each iteration result in increased memory consumption, based on the example you provided. In your code, a presentation is loaded, followed by various manipulations, and then saved in the PPTX format within a MemoryStream object. In a separate test case, distinct from your solution, we observed no increase in memory consumption after loading the presentation and subsequently saving it to PPTX in a MemoryStream object (we conducted 1000 iterations of loading and saving your presentation from the provided example).

@andrey.potapov Thank you for the update.
Yes the issue of memory increase with each iteration is due to the operations done on the ppt. That is our use case.
Please share the details from your developers on this specific scenario.

@ansamohdsh,
I am waiting for information from our developers for you. Thank you for your patience.

@andrey.potapov
Friendly reminder to share the updates. It has been 13days since i shared the POC code where issue was replicating

@ansamohdsh,
I’ve requested information from our developers for you again.

@ansamohdsh,
We have investigated the example you provided and conducted a series of tests on it.

In the example, the average memory consumption ranged from 7 GB to 11 GB on each iteration, and there was no observed increase in memory consumption during the test runs. We conducted different numbers of iterations: 20, 50, and 100. This scenario was run cyclically within a single process for several hours and more, and memory usage did not increase with each iteration. On the initial run of the scenario, there was a memory spike from 300 MB to 7 GB, followed by an increase to 11 GB on the next iteration. However, in subsequent iterations, memory consumption did not increase and remained in the range of 7 GB to 11 GB (regardless of the number of iterations).

After analyzing the example, it was noticed that the memory-consuming operations were as follows:

  1. (Approximately 3 GB) - creating a presentation from the template. The presentation contains 703 slides with a total of 58,810 shapes.
  2. (Approximately 4.2 GB) - saving the presentation to a MemoryStream.
    We also conducted additional testing based on your scenario with forced garbage collection on each iteration by calling the GC.Collect() method. The test results showed that there was no memory leak, and the average memory consumption on each iteration did not exceed 7.5 GB (70 iterations were performed).

As a result of testing, it was not noticed any memory leaks in your example, although there is a significant memory load due to the large number of elements in the resulting presentation.

Could you please clarify the following:

Are you primarily concerned about the issue of high memory consumption during presentation processing?
Are you experiencing a memory leak issue where memory consumption continuously grows until all available space is exhausted?