I have problems with mbox reader demo application. To suit my needs I have to anlize over 2GB Inbox file. Demo application raise an error on:
MboxrdStorageReader reader = new MboxrdStorageReader(stream, true);
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space at com.aspose.ms.System.IO.d.a(Unknown Source) at com.aspose.ms.System.IO.d.b(Unknown Source) at com.aspose.network.aQ.a(Unknown Source) at com.aspose.network.MboxStorageReader.(Unknown Source) at com.aspose.network.MboxrdStorageReader.(Unknown Source) at ThunderbirdMboxRead.main(ThunderbirdMboxRead.java:43)
I
understands that It is quite hard to load all the Inbox file into
memory, but is there a way to parse this huge file, get only messages
list and then extract only few of them?
Please accept my apologies for the delayed response.
I can reproduce the same exception with a small sized (~400MB) Mbox file and by using the latest version of Aspose.Email for Java v1.6.0. For correction purposes, a ticket (NETWRKJAVA-33137) has been logged in our bug tracking system.
We will keep you posted with updates on this.
[Edited] If you want to get notified regarding any progress on this issue then I would suggest you to create a new thread so I may attach the same ticket to it.
I am afraid to mention that the issue attached to this request is currently unresolved. The ticket is scheduled for upcoming release of Aspose.Email for Java v2.0.0. As soon as we have made significant progress towards the resolution of the ticket, we will let you know here.
We have worked with the issue mentioned in this thread. It proved to be a well known issue and have a simple solution, that is; increase the memory for java process through -Xms and -Xmx java command line options. Below is a sample command,
-Xms512m -Xmx1200m
Alternatively, give a try to the custom build of Aspose.Email for Java that is attached to this post. Below are code samples for your reference,
new MboxrdStorageReader(String fileName)
MboxrdStorageReader reader = new MboxrdStorageReader(mboxFileName);
try