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.

Fri Jan 27, 2023 8:37 am

Hi There,

We are facing a critical issue, where in spire is holding memory space even after the execution of the code is completed.

Is this something you'll are working on to fix?

So basically i am trying to convert presentation slides into images, so for testing purpose i tried with 4 mb ppt file which took 70 to 80 mb and might be even more to execute this task.
I understand the fact that spire take 10 times more space than the actual ppt size, but issue is when the required task is complete it should have release that memory space, which is not happening at the moment.

Is it something from our end where in we need to manually add some code to clear spire object memory allocation?

Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Fri Jan 27, 2023 10:26 am

Hello,

Thanks for your inquiry.
Does your code look like the following? To help us reproduce and solve your memory issue, please provide us with your ppt file and tell us your OS information (e.g. windows10 64bit). You can send it to support@e-iceblue.com or attach it here. Thanks for your assistance in advance.
Code: Select all
  //Create PPT document
            Presentation presentation = new Presentation();

            //Load PPT file from disk
            presentation.LoadFromFile("ToImage.pptx");

            //Save PPT document to images
            for (int i = 0; i < presentation.Slides.Count; i++)
            {
                String fileName = String.Format("ToImage-img-{0}.png", i);
                Image image = presentation.Slides[i].SaveAsImage();
                image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
                image.Dispose();
            }
            presentation.Dispose();
        }


Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Fri Jan 27, 2023 11:09 am

HI Amy,

amy.zhao wrote:Hello,

Thanks for your inquiry.
Does your code look like the following? To help us reproduce and solve your memory issue, please provide us with your ppt file and tell us your OS information (e.g. windows10 64bit). You can send it to support@e-iceblue.com or attach it here. Thanks for your assistance in advance.
Code: Select all
  //Create PPT document
            Presentation presentation = new Presentation();

            //Load PPT file from disk
            presentation.LoadFromFile("ToImage.pptx");

            //Save PPT document to images
            for (int i = 0; i < presentation.Slides.Count; i++)
            {
                String fileName = String.Format("ToImage-img-{0}.png", i);
                Image image = presentation.Slides[i].SaveAsImage();
                image.Save(fileName, System.Drawing.Imaging.ImageFormat.Png);
                image.Dispose();
            }
            presentation.Dispose();
        }


Sincerely,
Amy
E-iceblue support team


My code is somewhat like below
Code: Select all
//Create PPT document
            using(Presentation presentation = new Presentation())
           {

            //Load PPT file from memory stream
            presentation.LoadFromStream(stream, FileFormat.Pptx2013);

            //Save PPT document to images
            for (int i = 0; i < presentation.Slides.Count; i++)
            {
                using (Image image = presentation.Slides[i].SaveAsImage(1920, 1080))
                        {
                            //save the slide to Image
                            using (MemoryStream ms = new())
                            {
                                image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                                base64OfImage = Convert.ToBase64String(ms.ToArray());
                                //We save this base64 of image as Image s3 bucket
                            }

                        }
            }
        }

I also tried the code u have shared but the impact is same
OS : Windows 10 64 bit
PPT File : https://s3.us-east-2.amazonaws.com/zenevent.org/SecondScreenPPT/SecondScreenPPT_171_4997_368.pptx?feb725dc-551f-40a5-beab-841facdff3bc

Let me know if u need more info

Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Sat Jan 28, 2023 6:56 am

Hi,

Thank you for providing further info.
I tested your SecondScreenPPT_171_4997_368.pptx file and did reproduce your issue that memory is not clearing after disposing presentation object. There was still 154MB of RAM that has not been cleared after disposing presentation object. I have logged it in our issue tracking system with the ticket SPIREPPT-2153 to let our developers do a deep investigation. We will inform you once there is any update.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Mon Jan 30, 2023 5:03 am

amy.zhao wrote:Hi,

Thank you for providing further info.
I tested your SecondScreenPPT_171_4997_368.pptx file and did reproduce your issue that memory is not clearing after disposing presentation object. There was still 154MB of RAM that has not been cleared after disposing presentation object. I have logged it in our issue tracking system with the ticket SPIREPPT-2153 to let our developers do a deep investigation. We will inform you once there is any update.

Sincerely,
Amy
E-iceblue support team


For your information the file which i shared is just around 1 MB but we deal with much higher file size , So consider a scenario where in ill upload 100MB File so spire will take around 1GB of space to convert those into images and will hold 700 to 800 MB of memory space or even more.

plz do let me know as early as possible, bcz this package we are using in our production environment and our clients are getting affected by this as well as our server is going out of memory.

Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Mon Jan 30, 2023 6:45 am

Hello,

Thanks for providing further information. I have forwarded it to our Dev team. Considering your emergency, I have given SPIREPPT-2153 issue the highest priority.
We will do our best to finish its investigation and give you a feedback as early as possible.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Fri Feb 03, 2023 9:19 am

Hey there,

Any update on the above issue :?:

We are seriously having big trouble using it on our production server :( .

Thank You.

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Fri Feb 03, 2023 9:55 am

Hello,

I'm glad to tell you that our developer has done some improvements on memory clearing. Our test team will build a new version and test it soon.
We will inform you once new version is available. Sorry for any inconvenience caused by us again.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Fri Feb 03, 2023 10:20 am

Hi

That's Great....
Good to hear that!

Waiting eagerly for the new update.

Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Tue Feb 07, 2023 9:12 am

Hello,

I'm happy to inform you that new version has been released. Welcome to download and test Spire.Presentation Pack (Hotfix) Version:8.2.0.
Our website link: https://www.e-iceblue.com/Download/download-presentation-for-net-now.html
NuGet link: https://www.nuget.org/packages/Spire.Presentation/8.2.0

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Wed Feb 08, 2023 3:46 am

Hi Amy
Is the same fix added to Spire.Office?
I an using Spire.Office NuGet package which is still showing the 8.1.4 version,
i see that you'll have updated spire presentation with hotfix but what abt spire office?

I can individually download Spire.Presentation because i am also using Spire.Pdf so in order to use both the functionality together one of your team member had advised us to use Spire.Office


Hope I am Clear and soon we will get update for Spire.Office


Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Wed Feb 08, 2023 5:59 am

Hi,

Thanks for your feedback.
I have asked test team to build and test a new Spire.Office which includes the fix for SPIREPPT-2153. As Spire.Office is a collection of all products, we need some time to finish all tests for all products and then package them into Spire.Office. We can release a new official version within this month. But we can provide you with a temporary version soon, if you need it, please let me know. Please kindly note that the temporary version is not fully tested and will not be uploaded to NuGet.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Thu Feb 09, 2023 3:49 am

Hi Amy,

Thank you for providing an option of a temporary version but as of now we cant take risk of adding the temporary version of package to our production site.

Will wait for the official Spire.Office NuGet package.

Thank You

InnoviaPro
 
Posts: 23
Joined: Tue Apr 27, 2021 7:16 am

Thu Feb 09, 2023 6:09 am

Hi,

Thanks for your notice.
We will do our best to provide you with the official Spire.Office NuGet package asap.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Fri Feb 17, 2023 9:47 am

Hi,

Thanks for your patient waiting.
We have released the official Spire.Office NuGet package, Spire.Office Platinum(Hotfix) Version:8.2.2.
Website link: https://www.e-iceblue.com/Download/download-office-for-net-now.html
NuGet links:
https://www.nuget.org/packages/Spire.Officefor.NETStandard/8.2.2
https://www.nuget.org/packages/Spire.Office/8.2.2

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2774
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Presentation