Embedded video causes out of memory exception

Attempting to create an aspose Presentation object for a presentation containing large embedded video files throws an out of memory exception. Here is a link to an example .pptx with this issue: https://www.dropbox.com/s/l444z5ij6h12puk/embedded%20video.pptx?dl=0

Hi,

I have worked with the presentation file shared by you using Aspose.Slides for .NET 15.4.0 on my end. I have not been able to observe the issue on my end while loading the presentation. I suggest you to please try using the specified version on your end to serve the purpose.

Many Thanks,

Hi Mudassir,


I think the issue is that in production our users are limited to 2GB RAM and that presentations containing embedded videos are causing them to hit the limit. If your machine has more RAM available then this may explain why you are not encountering the crash. However, if you check task manager whilst creating the aspose object you should notice a significant increase in memory usage; I think the issue here is the excessive memory usage, rather than whether it causes an exception or not.

Possibly a duplicate of this issue: <a href="https://forum.aspose.com/t/15813

Hi,

I have worked with the presentation file shared by you using Aspose.Slides for .NET 15.4.0 and have tried exporting the presentation to PDF. The maximum memory that has been consumed for this is 800 MB at most which is far less than your 2Gb ram limit. For your kind reference, I have also attached the task manager image reflecting the maximum memory usage level achieved. Please share, if I may help you further in this regard.

As far as the link that you have shared is concerned, I like to share that Aspose.Slides is well suited for presentation size till 300~400 MB. The link that you have referred involves a presentation with 1 GB size. We have been able to to reproduce the issue with that presentation. I request you to please create a sample console based .NET application on your end to see if things are working. If there is no issue then you may need to increase the allocated memory quota for your application in the environment you are performing your actions using Aspose.Slides.

Many Thanks,

Hi Mudassir, after further investigation I have learned that our production users have a RAM limit of 1.5GB. Typically they have multiple applications running so they will have less than 1.5GB available which means that ~800MB is enough to cause an out of memory exception. Can the aspose slides memory usage be optimised? Microsoft PowerPoint uses less than 100MB to open the presentation.

Hi,

I have observed your comments and like to share that amount of memory required depends upon the size and content of presentation. There is no setting for optimizing memory usage in Aspose.Slides and it relies on memory allocated using .NET Framework. If the allocated memory is less than what is required for loading the presentation, the exception will be thrown.

Many Thanks,

Hi Mudassir,

On further investigation, it looks like Aspose (perhaps .NET libraries it uses internally) is trying to allocate the memory it requires in a contiguous block. So, it’s not so much of memory not being available, it’s how the available memory is requested by Aspose.
For example, Aspose is asking for 150 MB to be allocated in a contiguous block. If that user has got many applications running in the back ground, even if 150 MB is available, if it is fragmented Aspose fails with Memory error.

Is this something you guys can fix or is it more of a Microsoft problem?



Hi,

I have discussed the issue in detail regarding memory allocation used by Aspose.Slides. Actually, Aspose.Slides reads all presentation to memory add if the presentation contains a big video it will be readed as byte[] array. This structure requires contiguous block of memory. To change this behavior it is necessary to implement partial presentation reading. Implementing partial presentation reading is not possible at the moment owing to many other important tasks in product roadmap and also implementing this will block source presentation file as well because it is will be impossible to work with streams then. In present implementation you can create new presentation from some stream like below.

Presentation p = new Presentation(Stream stream);

Aspose.Slides reads all presentation and release the stream. After the change Aspose.Presentation will block stream unlimited time. But we will not know where this stream from. So if we decide to implement new behavior it will be necessary to save current implementation. And this is hard big work which is not scheduled. If this will be included in product roadmap then it may be included some where in 2016.

The workaround solution is to split the presentation and then try loading that using Aspose.Slides. However, if the presentation contains one slide with one big video then there is no workaround at the moment for that.

Many Thanks,

We are attempting to arrange a conference call regarding editing custom properties without loading the entire file as an aspose object. We feel that this would also resolve this issue, any help in setting up this call as soon as possible would be appreciated.

Hi,

I have observed your requirement related to arrangement of a conference call for editing custom properties without loading presentation file. I request you to please consult our business team in this regard. I will be obliged to help you here in product support forums and entertaining the technical inquiries concerning to product. Please share, if I may help you further in this regard.

Many Thanks,