We use 20.7 version of aspose slides.
Application exited with out of memory error.
When we check the heap dump we noticed the threads hold the same objects in heap as shown below
image.png (120.0 KB)
Also jvm log has details like below
<dependency_failed type=‘leaf_type’ ctxk=‘java/awt/image/BufferedImage’ witness=‘com/aspose/slides/internal/gz/case’ stamp=‘248240.400’/>
<dependency_failed type=‘unique_concrete_method’ ctxk=‘java/awt/image/BufferedImage’ x=‘java/awt/image/BufferedImage getRaster ()Ljava/awt/image/WritableRaster;’ witness=‘com/aspose/slides/internal/gz/case’ stamp=‘248240.400’/>
<dependency_failed type=‘unique_concrete_method’ ctxk=‘java/awt/image/BufferedImage’ x=‘java/awt/image/BufferedImage getRaster ()Ljava/awt/image/WritableRaster;’ witness=‘com/aspose/slides/internal/gz/case’ stamp=‘248240.400’/>
PPTx files roughly less than 10MB.
images size in that file is 9MB
image.png (6.0 KB)
How to fix this heap problem ?
sample code
Presentation presentation = new Presentation(inputStream);
ISlideCollection slides = presentation.getSlides();
int totalSlides = slides.size();
for (int no = 0; no < totalSlides; no++) {
ISlide slide = slides.get_Item(no);
IShapeCollection shapes = slide.getShapes();
if (null == shapes) {
continue;
}
for (IShape iShape : shapes) {
if (iShape.getName().equals("MyShapeName")) {
IAutoShape iAutoShape = (IAutoShape) iShape;
if (iAutoShape.getTextFrame().getText().equals(watermarkText)) {
return true;
}
}
}
}