Hi @Omkar Deshpande ,
Welcome!
According to your description, you were trying to process large PST file programmatically. So, are you using Outlook desktop client or something else? I tried some research about Outlook memory error, in Outlook desktop client, similar issue might indeed happen when you open large size of PST files or corrupted PST files. Please check the suggestions in this article and see if it could make this issue better. (Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.)
Any update, please feel free to post back.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.