Hi,
I have an email with an inline image in the body.
I have been following the guide below
https://docs.aspose.com/display/emailjava/Saving+A+MSG+as+PDF
eml.save(emlStream, SaveOptions.getDefaultMhtml());
The above line consistently causes one of two errors:
Caused by: java.lang.OutOfMemoryError: Java heap space
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
Below is an extract of one of the times:
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
at sun.text.normalizer.UCharacterIterator.getInstance(UCharacterIterator.java:84)
at sun.text.normalizer.NormalizerBase.setText(NormalizerBase.java:1002)
at java.text.CollationElementIterator.setText(CollationElementIterator.java:505)
at java.text.RuleBasedCollator.compare(RuleBasedCollator.java:383)
at com.aspose.email.internal.k.a.b(Unknown Source)
at com.aspose.email.internal.k.a.a(Unknown Source)
at com.aspose.email.internal.k.a.a(Unknown Source)
at com.aspose.email.internal.b.aq.b(Unknown Source)
at com.aspose.email.internal.b.aq.f(Unknown Source)
at com.aspose.email.MhtMessageFormatter.a(SourceFile:635)
at com.aspose.email.MhtMessageFormatter.format(SourceFile:480)
at com.aspose.email.MailMessage.a(SourceFile:5691)
at com.aspose.email.MailMessage.a(SourceFile:2311)
at com.aspose.email.abd.a(SourceFile:2365)
at com.aspose.email.internal.eg.a.a(Unknown Source)
at com.aspose.email.internal.eg.b.a(Unknown Source)
at com.aspose.email.MailMessage.save(SourceFile:2363)
at xxx.xxx.xxx.xxx.xxx.EmailContentSplitter.split(EmailContentSplitter.java:58)
I will attach two example .msg files which I get the issue with.
exampe-msgs.zip (35.2 KB)
Below are my memory VM options:
-Xms256m
-Xmx1024m
-XX:PermSize=256m
-XX:MaxPermSize=384m
Is there an issue in the code that handles the save?
Are there any alternative methods of doing the same task?