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

Free Support Forum - aspose.com

OutOfMemoryError: Java heap space when creating large PST files


We are evaluating the Aspose Email library for creating PST files in Java. We have a need to create very large PST files, but it appears that the Aspose library (version has trouble with these, resulting in the following exception even when creating relatively smaller (400MB) PST files.

We can increase the VM max heap size, but our concern is that no matter how much memory we let the heap consume, we will eventually hit an OutOfMemoryError.

Is it possible to use the Aspose library in such a way that it does not consume so much memory when creating large PST files?

   java.lang.OutOfMemoryError: Java heap space
at com.aspose.email.aey.a(SourceFile:71)
at com.aspose.email.aex.a(SourceFile:19)
at com.aspose.email.vw.a(SourceFile:24)
at com.aspose.email.MapiMessageReader.readMessage(SourceFile:143)
at com.aspose.email.MapiMessage.a(SourceFile:1168)
at com.aspose.email.MapiMessage.deepClone(SourceFile:2022)
at com.aspose.email.MapiMessage.d(SourceFile:2264)
at com.aspose.email.tg.a(SourceFile:1590)
at com.aspose.email.acy.a(SourceFile:941)
at com.aspose.email.acy.a(SourceFile:896)
at com.aspose.email.FolderInfo.addMessage(SourceFile:769)

Hi Joe,

Thank you for posting your inquiry.

The issue seems to be related to some specific message files at your end as we are unable to reproduce it at our end with the set of messages at our end. I request you to please share your sample message files with us so that we can run this test at our end and share our feedback with you. Also, please share your application’s heap size with us as it will help us in our investigation.