Hi there,
i am evaluating groupDocs.conversion version 19.6.2
using amazon Corretto open Jdk 1.8 on windows 7 machine 8gb ram
with -Xmx3072m jvm heap space allocated.
while converting Ms office document to jpg format in single threaded mode it works fine
but when i run it with 10 threads using java executor service i am getting following error
com.groupdocs.conversion.domain.savers.words.WordsToImageSaver.save(Unknown Source)
com.groupdocs.conversion.domain.documents.WordsDocument.save(Unknown Source)
com.groupdocs.conversion.operations.f.aK(Unknown Source)
com.groupdocs.conversion.operations.E.execute(Unknown Source)
com.groupdocs.conversion.converter.image.ImageConverter.convert(Unknown Source)
com.groupdocs.conversion.converter.image.ImageConverter.convert(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.aJ(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source)
com.poc.digo.tools.GroupDocsConvertor.convertToPdfAsFilePath(GroupDocsConvertor.java:95)
com.poc.digo.tools.GroupDocsConvertor.Convert(GroupDocsConvertor.java:56)
com.poc.digo.main.Launcher.lambda$2(Launcher.java:96)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748) —> class com.groupdocs.conversion.exception.GroupDocsException: com.groupdocs.conversion.internal.c.a.w.internal.uN: Could not create the bitmap with the specified parameters: java.lang.OutOfMemoryError: Java heap space —> com.groupdocs.conversion.internal.c.a.w.internal.uN: Could not create the bitmap with the specified parameters: java.lang.OutOfMemoryError: Java heap space
com.groupdocs.conversion.domain.documents.WordsDocument.a(Unknown Source)
com.groupdocs.conversion.domain.DocumentBase.load(Unknown Source)
com.groupdocs.conversion.operations.r.aT(Unknown Source)
com.groupdocs.conversion.operations.r.c(Unknown Source)
com.groupdocs.conversion.operations.r$3.invoke(Unknown Source)
com.groupdocs.conversion.operations.r.aZ(Unknown Source)
com.groupdocs.conversion.operations.r.execute(Unknown Source)
com.groupdocs.conversion.converter.image.ImageConverter.convert(Unknown Source)
com.groupdocs.conversion.converter.image.ImageConverter.convert(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.aJ(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source)
com.groupdocs.conversion.handler.ConversionHandler.convert(Unknown Source)
com.poc.digo.tools.GroupDocsConvertor.convertToPdfAsFilePath(GroupDocsConvertor.java:95)
com.poc.digo.tools.GroupDocsConvertor.Convert(GroupDocsConvertor.java:56)
com.poc.digo.main.Launcher.lambda$2(Launcher.java:96)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
— End of inner exception stack trace —
can you please help me to sort out this
i am using following code block
conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(request.getInputDir());
conversionConfig.setOutputPath(request.getOutputDir());
conversionConfig.setUseCache(false);
//conversionConfig.setCachePath(cachePath);
//conversionConfig.getFontDirectories().add(fontsPath);
// Generate cache
//conversionConfig.setUseCache(true);
ImageSaveOptions imagesaveOption = new ImageSaveOptions();
imagesaveOption.setConvertFileType(ImageSaveOptions.ImageFileType.JPG);
imagesaveOption.setJpegQuality(100);
imagesaveOption.setHorizontalResolution(300);
imagesaveOption.setVerticalResolution(300);
convertedDocumentPath = conversionHandler.<List<String>>convert(guid, imagesaveOption);
for (int i = 1; i <= convertedDocumentPath.getPageCount(); i++) {
convertedDocumentPath.save(guid + i + "." + convertedDocumentPath.getFileType(), i);
logger.info(guid + i + "." + convertedDocumentPath.getFileType());
}
com.groupdocs.conversion.internal.c.a.w.internal.uN: Could not create the bitmap with the specified parameters: java.lang.OutOfMemoryError:
for this error (android - Strange OutOfMemory issue while loading an image to a Bitmap object - Stack Overflow) here is some solution which can help up to solve this
and for documents to PDF conversions its working fine
but time taken to process is not relevant
for document(all type of MS office and open office formats) to PDF conversion
for 30 documents single threaded its taking 52 seconds
for 30 documents 10 threaded its taking 35 seconds
does GroupDocs.conversion Relly works with Multithreaded environment ?
Thank you,
Swapnil.