I’m getting the following exception while trying to extract a message from a PST file:
Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
Below is my code:
PersonalStorage pst = PersonalStorage.fromFile("test.pst"); FolderInfo folderInfo = pst.getRootFolder().getSubFolder("Inbox"); MessageInfoCollection messageInfoCollection = folderInfo.getContents(); MessageInfo messageInfo = (MessageInfo) messageInfoCollection.get_Item(712); // this is the number of message which causes the exception MapiMessage message = pst.extractMessage(messageInfo);
How can I solve this issue?