Presentation.save Method Throws Exception: Requested Array Size Exceeds VM Limit

During the conversion of some pptx we see this error “Requested array size exceeds VM limit”.
Any solution?

We use the version 18.10:jdk16 of aspose java library for slides

@mgiardi,

I have observed your comments. Can you please share source file along with environment details so that we may further investigate to help you out. Before sharing requested information please try to use Aspose.Slides latest version 18.11 on your end and if there is still an issue than please share files.

the new version 18.11 fixed the issue on most of the documents, but I still get the same issue on one document. Unfortunately I can’t share the document as it contains sensitive information

@mgiardi,

I have observed your comments and like to share that in order to investigate the issue further on our end we require the source presentation. Please provide the requested information so that we may proceed further to help you out.

we’re in same trouble, source file as attached.pptResource-E.zip (122.0 KB)

@landongyun,

Can you please share sample code or can you please share in which format you are converting this file. Also please share which Aspose.Slides version you are using on your end.

@Adnan.Ahmad
// we spit one side into pieces using addclone method. Error occures when saving.
// below is my source code:
Presentation srcPres = new Presentation(rsFile.getPath());
ISlideCollection subSlides = srcPres.getSlides();
int i = 1;
Dimension2D size = srcPres.getSlideSize().getSize();
String pptName = ObjectUtil.subStrForName(json.getString(“fileName”));
for (ISlide sub : subSlides) {
Presentation destPres = new Presentation();
ISlideCollection slds = destPres.getSlides();
destPres.getSlideSize().setSize(new Float(size.getWidth()), new Float(size.getHeight()),
srcPres.getSlideSize().getType());
slds.removeAt(0);
slds.addClone(sub);
destPres.save(slidesSavePath + pptName + “_” + i + “.pptx”, SaveFormat.Pptx);
i++;
}

@landongyun,

I have worked with the sample file shared by you. An issue with ID SLIDESJAVA-37714 has been created in our issue tracking system to further investigate and resolve the issue. We will share good news with you soon.

The issues you have found earlier (filed as SLIDESJAVA-37714) have been fixed in Aspose.Slides for Java 22.1 (ZIP).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.