Hi Team,
We are using aspose slides (aspose-slides 18.6) with spring MVC for creating .pptx files which mainly contains, graphs, charts and images.Each generated pptx file will have around 200 slides.
this works fine for one user. But, when multiple requests comes in, out 5 only 2 will get pptx file generated, others will fail with java.lang.outofmemoryerror gc overhead limit exceeded. . Please help us with the exception and work around to work with concurrent user able to generate pptx files.
ByteArrayOutputStream bos = new ByteArrayOutputStream();
Presentation ppt = null;
Presentation pptUpdated = null;
try{
AsposeLicense.initiateLicenseForPpt(filePath.toString());
LoadOptions loadOptions = new LoadOptions();
loadOptions.getBlobManagementOptions().setPresentationLockingBehavior(PresentationLockingBehavior.KeepLocked);
ppt = new Presentation(path,loadOptions);
pptUpdated=updatePPTWithData(ppt, reportVO, actualSelObj, criteria); // code to populated data in ppt
pptUpdated.save(bos, SaveFormat.Pptx);
out = response.getOutputStream();
out.write(bos.toByteArray());
}catch(Exception e){
LOGGER.log(Level.ERROR, "Report generation failed : " + e);
e.printStackTrace();
}finally{
try{
ppt.dispose();
pptUpdated.dispose();
out.flush();
out.close();
bos.close();
}catch(Exception exeption){
LOGGER.log(Level.ERROR, exeption);
}
}