OutOfMemory due to Mail Loop

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

Summary

Symptoms

JIRA crashes or behaves unpredictably. Email notifications may stop being sent. Logs contain errors like:

1 java.lang.OutOfMemoryError: Java heap space

Diagnosis

In addition to Java heap space error, the following will be logged in atlassian-jira-incoming-mail.log:

1 2020-06-16 11:30:17,600 ERROR [] Caesium-1-4 ServiceRunner MailJobRun java.lang.OutOfMemoryError: Java heap space

Cause

JIRA can get caught in a mail loop, where a notification is sent to an inbox that is then processed by a mail handler.

Solution

Workaround

  1. As a temporary measure, increase JIRA's Heap Space allocation.

  2. Restart JIRA

  3. Configure either the Notification scheme or the Mail Handler to prevent the loop. It is generally a good idea to set bulk=forward and set a Forward Email address, to prevent mail loops between JIRA and another automated service (eg. another JIRA installation). See Handler Parameters for details on how to set the parameters for the handler.

See JRASERVER-11074 for further updates.

Updated on April 7, 2025

Still need help?

The Atlassian Community is here for you.