Problem with loading .EML file into MailMessage Object using Aspose.Email for java

Hello Team,


I have to load .EML file into MailMessage but i got Java heap space exception.I have to convert mbox file into PST file.I am using Operating System "Mac OS X 10.10.5 " and language java.
My source .EML file size is of 42MB so it get fail.

***short source code


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}

f_objMailMessage = MailMessage.load(f_ObjFile.getAbsolutePath()) ;


*****


Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

at com.aspose.email.system.io.MemoryStream.setCapacity(Unknown Source)

at com.aspose.email.system.io.MemoryStream.b(Unknown Source)

at com.aspose.email.system.io.MemoryStream.write(Unknown Source)

at com.aspose.email.mw.write(SourceFile:321)

at com.aspose.email.dv.a(SourceFile:167)

at com.aspose.email.agh.a(SourceFile:377)

at com.aspose.email.agh.a(SourceFile:252)

at com.aspose.email.agh.a(SourceFile:265)

at com.aspose.email.agh.c(SourceFile:157)

at com.aspose.email.MailMessage.a(SourceFile:1402)

at com.aspose.email.MailMessage.b(SourceFile:1316)

at com.aspose.email.MailMessage.a(SourceFile:1238)

at com.aspose.email.MailMessage.load(SourceFile:1223)

at SysTools.MBOX_Reader.main

Hello Team,


I have to load .EML file into MailMessage but i got Java heap space exception.I have to convert mbox file into pst file.I have to convert MBOX file into PST file in java.

Below is my code to load eml into mailmessage.

Please file test samples for reference. I have send EML file in .zip format.I have a Mac OS X 10.10.5 (14F27).And java8.

f_objMailMessage = MailMessage.load(f_ObjFile.getAbsolutePath()) ;


but i got below exception.


->Exception

Exception in thread “main” java.lang.OutOfMemoryError: Java heap space

at com.aspose.email.system.io.MemoryStream.setCapacity(Unknown Source)

at com.aspose.email.system.io.MemoryStream.b(Unknown Source)

at com.aspose.email.system.io.MemoryStream.write(Unknown Source)

at com.aspose.email.mw.write(SourceFile:321)

at com.aspose.email.dv.a(SourceFile:167)

at com.aspose.email.agh.a(SourceFile:377)

at com.aspose.email.agh.a(SourceFile:252)

at com.aspose.email.agh.a(SourceFile:265)

at com.aspose.email.agh.c(SourceFile:157)

at com.aspose.email.MailMessage.a(SourceFile:1402)

at com.aspose.email.MailMessage.b(SourceFile:1316)

at com.aspose.email.MailMessage.a(SourceFile:1238)

at com.aspose.email.MailMessage.load(SourceFile:1223)

at SysTools.MBOX_Reader.main

Hi Ajinath,


We are sorry for the inconvenience you are facing.

As shared with you on another thread of yours, the issue came out to be related to the heap size settings in project settings. Please increase the heap size of your project to get this resolved and let us know your feedback.