Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Mon Mar 20, 2023 6:39 am

Hello,

I have tried upgrading to the latest Spire.Presentation 8.2.0 but I am still encountering an issue where some of the memory are not cleared after creating the Spire objects even after I have disposed them.
Here is a sample of our memory snapshots:
- Snapshot 1: Breakpoint after calling API to create ppt, at the very start of the code before any Spire related objects are created.
- Snapshot 2: Breakpoint before the end of the API and before disposing Spire objects. There are 2M objects and heap size is 112KB.
- Snapshot 3: Breakpoint after disposing Spire objects, before ending the API call. There are still 2M objects even after disposing and heap size is still at 100MB
- Snapshot 4: 1 minute after the end of the API calls. No other operations or API calls made. There are still 1M objects and heap size is 82MB. Upon further checking snapshot 4, most of the objects and the size in the heap is consumed by Hashtable and spire objects.
memory hash.jpg


Code snippet looks like this:
Code: Select all
using (var templatePresentation = new Spire.Presentation.Presentation())
{
  var templatePresentationItem = new Spire.Presentation.Presentation();
  templatePresentationItem.LoadFromFile(filePath);
  // some code
  templatePresentationItem.Dispose();

  templatePresentation.LoadFromFile(filePath);
  // some code

  var presentation = new Spire.Presentation.Presentation();
  //some code to copy properties and master from templatePresentation to presentation and generate presentation slides

  presentation.Dispose();
}

boncyrus
 
Posts: 20
Joined: Wed Mar 01, 2023 10:01 am

Tue Mar 21, 2023 11:38 am

Hi,

We appreciate your feedback regarding the issue of memory not being completely cleared after using our product. After discussions with our development team, we found that the process may include some Visual Studio settings and our product's static variables and font information, which can be time-consuming to load.
We want to assure you that we have recently optimized our memory clearing processes to ensure that unnecessary data is promptly removed from your system. Thanks for your understanding.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Mon Mar 27, 2023 8:45 am

We are using the latest version 8.2.0 but it's still using the same amount of memory and not clearing it. This is causing our servers to crash.

What version has this optimised memory clearing?

majeed_s
 
Posts: 80
Joined: Thu Mar 25, 2021 4:13 pm

Tue Mar 28, 2023 3:14 am

majeed_s wrote:We are using the latest version 8.2.0 but it's still using the same amount of memory and not clearing it. This is causing our servers to crash.

What version has this optimised memory clearing?

Hi,

Thanks for your feedback.
Our development team adjusted the code in version 8.2.0 to address concerns relating to memory usage. However, we would like to point out that the amount of memory used by a process is affected by factors beyond our control, including system components and other tools running alongside our product. Sorry for the inconvenience caused.
You could try call GC.Collect(); and GC.WaitForPendingFinalizers(); after the program has finished running. This may help to forcibly release any remaining memory that was not cleared automatically.
We appreciate understanding as we work to improve the performance of our product. Please do not hesitate to contact us if you have any other questions or concerns.

Best regards,
Trsite
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Wed Apr 19, 2023 5:02 pm

We are already using GC.Collect(); and GC.WaitForPendingFinalizers() but it has no real impact. This is a major blocker for us.

We upgraded to 8.4.1 but there was no performance improvements. In fact, there was slight higher number of remaining objects in memory compared to 8.3.2. See screenshot, there is not remaining 1.9M objects after process and GC.Collect compared to before screenshot where there are only 1.8M objects remaining

3b606737-b96f-4fd9-a6ec-d7be25472dce.png

boosted_d16
 
Posts: 34
Joined: Wed Apr 19, 2023 11:41 am

Thu Apr 20, 2023 8:01 am

Hi,

Thanks for your feedback.
To help us better diagnose the issue, we kindly request that you provide us with some test documents that will allow us to conduct a more detailed analysis. This will enable our developers to identify the root cause of the memory leak and implement an appropriate optimization. You can send them to us via email(support@e-iceblue.com) or attach them here. Thanks for your assistance.

Best regards,
Triste
E-iceblue support team
User avatar

Triste.Dai
 
Posts: 1000
Joined: Tue Nov 15, 2022 3:59 am

Return to Spire.Presentation

cron