We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error occurred during imaging processing with error 'Java heap space'

Big Email.7z (766.0 KB)
Unexpected error occurred during imaging processing with error ‘Java heap space’

Version Aspose.Email 21.2

Sample Code:
FileInputStream fstream = new FileInputStream(inputFilePath);
MailMessage email = MailMessage.load(fstream);

Stack Trace:
java.lang.OutOfMemoryError: Java heap space at java.lang.String.toCharArray(String.java:2899) at com.aspose.email.internal.b.zar.c(SourceFile:1955) at com.aspose.email.internal.b.zar.g(SourceFile:1940) at com.aspose.email.internal.ae.zl.c(Unknown Source) at com.aspose.email.zbht.d(SourceFile:176) at com.aspose.email.zaiz.b(SourceFile:757) at com.aspose.email.zaiz.a(SourceFile:270) at com.aspose.email.MailMessage.a(SourceFile:1479) at com.aspose.email.MailMessage.c(SourceFile:1345) at com.aspose.email.MailMessage.a(SourceFile:1252) at com.aspose.email.MailMessage.load(SourceFile:1246) at com.stormed.common.utils.ImageUtils.emailToPdf(ImageUtils.java:108) at com.stormed.image.EpI_ImgDrafting.getImgPath(EpI_ImgDrafting.java:71) at com.stormed.image.ImageMain.(ImageMain.java:45) at com.stormed.image.common.ImageBuilder.run(ImageBuilder.java:26) at com.stormed.proxy.AppRunner.run(AppRunner.java:18) at com.stormed.proxy.ProxyMain.runApp(ProxyMain.java:245) at com.stormed.proxy.ProxyMain.lambda$main$0(ProxyMain.java:121) at com.stormed.proxy.ProxyMain$$Lambda$30/53807796.call(Unknown Source) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

I can provide the Email File we’re using if I can find a way to attach it.
edit: Was able to attach it after 7z it.
Big Email.7z (766 KB)

@cpostlethwait

Can you please try using latest Aspose.Email for Java 21.6 on your end and also increase the Java heap size as the exception is owing to smaller heap size on your end.