OutOfMemory due to Large Mailbox Processing
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
This page describes a singular cause for Out Of Memory Heap Space Errors. Refer to JIRA Crashes Due to OutOfMemoryError Java heap space for a general discussion.
Symptoms
JIRA crashes or behaves unpredictably when processing email. Logs contain errors like:
java.lang.OutOfMemoryError: Java heap space
Cause
JIRA's email handler will continually scan a mailbox trying to clear out messages. As it processes the email it will keep allocating memory to the task and eventually run out of memory. With hundreds of thousands of emails in a mailbox watched by the email handler, JIRA can run out of memory.
Diagnosis
To assess this issue, check the accounts configured from Creating Issues and Comments from Email. The troubleshooting section of that page offers tips on how to debug mail messages, which you can count to see the volume of mail handled.
Resolution
- As a temporary measure, increase JIRA's Heap Space allocation.
- Clean out the mailbox and double-check its settings.