我在使用Aspose.slides过程中,发现在通过slides将PPT文件转换成PDF文件时,内存占用过高,并且转换成功以后内存也不会被释放,始终占用1~2G的内存,请问这是什么原因?有没有什么办法释放掉被占用的内存?
if(slicingInfo.isNeedEncode()){
//解码后转化为PDF文件
sourceInputStream = new ByteArrayInputStream(SM4Utils.decryptFileReadOnly(sourceFilePath));
}else{
sourceInputStream = new FileInputStream(sourceFilePath);
}
Presentation pres;
com.aspose.slides.LoadOptions options = new com.aspose.slides.LoadOptions(LoadFormat.Auto);
options.setDefaultRegularFont("Arial");
options.setDefaultAsianFont("Arial");
options.setDefaultSymbolFont("Arial");
if (!StringUtils.isEmpty(slicingInfo.getPassword())) {
//com.aspose.slides.LoadOptions options = new com.aspose.slides.LoadOptions();
options.setPassword(slicingInfo.getPassword());
pres = new Presentation(sourceInputStream, options);
} else {
pres = new Presentation(sourceInputStream, options);
}
PdfOptions pdfOptions=new PdfOptions();
pdfOptions.setSaveMetafilesAsPng(true);
pdfOptions.setTextCompression(PdfTextCompression.None);
pdfOptions.setCompliance(com.aspose.slides.PdfCompliance.Pdf15);
pres.save(convertPdfFileOut, com.aspose.slides.SaveFormat.Pdf);