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.

Wed Feb 22, 2023 11:36 am

Hi Amy

Is there any specific code changes i need to make to get rid of this allocated memory or spire itself will handle this memory release process.

the reason m asking this because after updating to latest version of spire m facing same issue.

A quick question is there any recommended max ppt file size after which this memory issue is faced?

PFA

For testing purpose i have taken small ppt
Please test with more then 10MB of file from ur side

Thank You

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

Tue Feb 28, 2023 9:04 am

Hi,

I'm so sorry for the long silence.
Please have a try with the following code. I made a 11MB pptx file with your pptx data to do a test. The issue didn't occur on my side.


Code: Select all
     using(Presentation presentation = new Presentation())
               {
                 ppt.LoadFromFile(inputFile);
                for (int i = 0; i < ppt.Slides.Count; i++)
                  {
                    string fileName = string.Format(outputFile + "img_{0}.png", i);
                    using (Image image = ppt.Slides[i].SaveAsImage()) {
                        image.Save(fileName, ImageFormat.Png);
                    }
                }
                GC.Collect();
                GC.WaitForPendingFinalizers();


Sincerely,
Amy
E-iceblue support team
User avatar

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

Thu Mar 02, 2023 9:57 am

Hi Amy

Unfortunately we are still facing the issue. as i can see from your last reply you have used a 11 mb file, so one request is can u test the same with more than 100 MB File

Below are the details required

1) input file :- cannot share the ppt file as it has sensitive data of client
test File Size 168 MB (on production we have more than 300MB file)
Number of Slide in above test file : 71
2) Code
Code: Select all
using (Presentation presentation = new())
                {

                    using (MemoryStream _stream = new(Convert.FromBase64String(base64DataOfPPT)))
                    {
                        presentation.LoadFromStream(_stream, FileFormat.Pptx2013);
                    }
                    var base64 = "";
                    for (int i = 0; i < presentation.Slides.Count; i++)
                    {
                        using (Image image = presentation.Slides[i].SaveAsImage(1920, 1080))
                        {
                            using (MemoryStream ms = new())
                            {
                                image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
                                base64 = Convert.ToBase64String(ms.ToArray());
                            }
                        };
                        //Save the image on aws server uisng base64 string of image
                    }
                    base64 = null;
                }
                GC.Collect();
                GC.WaitForPendingFinalizers();

3) Spire.Office version 8.2.2
4) Windows
5) web application asp.net core 6 with react js as front end

Let me know if u want more details regarding this

Thank You

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

Fri Mar 03, 2023 8:05 am

Hi,

Thanks for your further feedback.
I communicated with our developers. The feedback I get is that the default static data and font data used after execution would not be released, So the data you see not being cleaned up should be them. This saves execution time by avoiding having to initialize it again in the next execution. I hope you could understand.

Sincerely,
Amy
E-iceblue support team
User avatar

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

Fri Mar 03, 2023 8:49 am

amy.zhao wrote:Hi,

Thanks for your further feedback.
I communicated with our developers. The feedback I get is that the default static data and font data used after execution would not be released, So the data you see not being cleaned up should be them. This saves execution time by avoiding having to initialize it again in the next execution. I hope you could understand.

Sincerely,
Amy
E-iceblue support team


Hi Amy
If the default static/font data size was 100 MB or at least less than a 500MB i could have understood but here the data size is increasing in GB's
You please test with a 100MB file and check the amount of data spire is holding and imagine if the ppt file is of more than 100MB how much data it will store
Last time our production site crashed bcz our entire memory was consumed by spire data.
Hope you understand how critical this issue is.

at least give us a workaround for this.

Thank You

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

Fri Mar 03, 2023 10:25 am

Hi,

I'm sorry to hear that you're experiencing issues with Spire data size. May I know if the remaining memory you are referring to after the program has finished running is the process memory or the heap memory?
I will use a 100MB or larger file to do a test and get back to you once I finish it.

One possible workaround is to split the large PPT file into smaller chunks and process them one by one. If you can consider it, please try it.


Sincerely,
Amy
E-iceblue support team
User avatar

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

Sat Mar 04, 2023 10:07 am

amy.zhao wrote:Hi,

I'm sorry to hear that you're experiencing issues with Spire data size. May I know if the remaining memory you are referring to after the program has finished running is the process memory or the heap memory?
I will use a 100MB or larger file to do a test and get back to you once I finish it.

One possible workaround is to split the large PPT file into smaller chunks and process them one by one. If you can consider it, please try it.


Sincerely,
Amy
E-iceblue support team


Hi Amy

I am not sure whether the remaining memory is process memory or heap memory bcz we have not analyzed the production server for this memory issue. You will definitely get answer for this once u test a ppt file of size more than 100mb.

the workaround which u gave wont be helpful bcz even if I split the ppt spire will take same amount of memory to process them.

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

Mon Mar 06, 2023 9:46 am

Hello,

Thank you for your patience. I have tested with a 135MB PPTX file and was unable to reproduce the memory issue you encountered. I have attached a screenshot of my test results.
To help us reproduce your issue more quickly and provide you with a solution as soon as possible, could you provide a document that can reproduce your problem? If possible, please provide a complete executable project. You could send your files to support@e-iceblue.com.


Sincerely,
Amy
E-iceblue support team
User avatar

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

Thu Mar 30, 2023 3:34 am

Hi Amy,

Sorry for the delay in reply, Give me some time ill compile an application with spire plugin and send it over.

Thank You

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

Thu Mar 30, 2023 3:50 am

Hello,

Thank you for your response.
I appreciate your efforts in compiling an application with the Spire plugin. Please take your time to do so, and let me know when it's ready to be sent over.

If you have any questions or concerns, please don't hesitate to reach out to me.

Sincerely,
Amy
E-iceblue support team
User avatar

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

Tue Apr 04, 2023 4:17 am

Hi Amy

I have sent the complete executable project along with the ppt on support@e-iceblue.com.

Please check and let me know what you'll find out

Thank You

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

Tue Apr 04, 2023 6:26 am

Hello,

I carefully checked all our emails but didn't receive the email you sent to support@e-iceblue.com.
Could you please check if it was sent successfully?

Sincerely,
Amy
E-iceblue support team
User avatar

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

Tue Apr 04, 2023 9:25 am

amy.zhao wrote:Hello,

I carefully checked all our emails but didn't receive the email you sent to support@e-iceblue.com.
Could you please check if it was sent successfully?

Sincerely,
Amy
E-iceblue support team



Hi Amy

Please check mail from gourish@edot-solutions.com

Thank You

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

Tue Apr 04, 2023 10:08 am

Hi,

I have double-checked all our emails and still haven't received your email. If your file was sent as an attachment, I suspect that maybe it failed to send due to its large size. Could you please try uploading the file to a cloud storage service and provide us with a download link instead?

Thank you very much for your assistance.

Sincerely,
Amy
E-iceblue support team
User avatar

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

Wed Apr 05, 2023 4:01 am

amy.zhao wrote:Hi,

I have double-checked all our emails and still haven't received your email. If your file was sent as an attachment, I suspect that maybe it failed to send due to its large size. Could you please try uploading the file to a cloud storage service and provide us with a download link instead?

Thank you very much for your assistance.

Sincerely,
Amy
E-iceblue support team


Hi Amy

The executable file is just 29MB and i am pretty sure that the email has been sent along with the attachments.

Anyways not to delay more below is the google drive link of the complied executable of the application where we are getting the memory issue. Along with the executable I have also attached one ppt which is failing to get converted into images.
https://drive.google.com/drive/folders/1hHhhXq1EAH-mdfxMUM4hBbs7_6OSHWzF?usp=sharing

We are facing major issue as this is impacting our production site/server, Hope you'll will find quick solution to this issue.

One more thing i wanted to know if spire presentation has some restriction on converting the ppt slide having some charts, tables etc.
If yes then plz provide the list of component which cannot be converted to images via spire presentation

Let me know if you need any further details.

Thank you

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

Return to Spire.Presentation

cron