Too many open files error in Jira server

Still need help?

The Atlassian Community is here for you.

Ask the community


A JIRA application experiences a general loss of functionality in several areas.

The following error appears in the atlassian-jira.log: Too many open files

To identify the current open file handler count limit please run:

ulimit -aS | grep open

And then look at the row which looks like:

open files                      (-n) 2560    


UNIX systems have a limit on the number of files that can be concurrently open by any one process. The default for most distributions is only 1024 files, and for certain configurations of JIRA applications, this is too small a number. When that limit is hit, the above exception is generated and JIRA applications can fail to function as it cannot open the required files to complete its current operation.

There are certain bugs in the application that are known to cause this behaviour:

We have the following improvement requests to better handle this in JIRA applications:


These changes will only work on installation that uses built in initd script for starting Jira. For installations that uses custom build service for systemd (latest versions of linux OS-es) changes will need to be applied directly in that systemd service configuration in a form of:


In most cases, setting the ulimit in JIRA's should work:

  1. If the $JIRA_HOME/caches/indexes folder is mounted over NFS move it to a local mount (i.e. storage on the same server as the JIRA instance). NFS is not supported as per our JIRA application Supported Platforms and will cause this problem to occur at a much higher frequency.
  2. Stop the JIRA application.
  3. Edit $JIRA_INSTALL/bin/ to include the following at the top of the file:

    ulimit -n 16384

    This will set that value each time JIRA applications are started, however, it will need to be manually migrated when upgrading JIRA applications.

  4. Start your JIRA application.
  5. The changes can be verified by running /proc/<pid>/limits where <pid> is the application process ID.

If you are using a JIRA application version with the bug in JRA-29587 - Getting issue details... STATUS , upgrade it to the latest version. If using NFS, migrate to a local storage mount.

Notice that some operating systems may require additional configuration for setting the limits. For example, Ubuntu users would follow the below (please see your operating system's manual for details):

  1. Modify the limits.conf file with the following command:
    sudo vim /etc/security/limits.conf 
  2. Add the following for the user that runs JIRA applications. If you have used the bundled installer, this will be jira.

    #<domain>      <type>  <item>         <value>
    #*               soft    core            0
    #root            hard    core            100000
    #*               hard    rss             10000
    #@student        hard    nproc           20
    #@faculty        soft    nproc           20
    #@faculty        hard    nproc           50
    #ftp             hard    nproc           0
    #ftp             -       chroot          /ftp
    #@student        -       maxlogins       4
    jira           soft    nofile          16384
    jira           hard    nofile          32768 
  3. Modify the common-session file with the following:

    sudo vim /etc/pam.d/common-session
    (info) common-session is a file only available in debian/ubuntu

  4. Add the following line:

    # The following changes were made from the JIRA KB (
    session required
  5. Restart the JIRA server application.
tip/resting Created with Sketch.

For exceedingly large instances, we recommend consulting with our partners for scaling JIRA applications. See Is Clustering or Load Balancing JIRA Possible.


In order to identify what files are kept open, the lsof +L1 command can be used. This will provide a list of the open files, for example:

java     2565  dos  534r   REG   8,17    11219     0 57809485 /home/dos/deploy/applinks-jira/temp/jar_cache3983695525155383469.tmp (deleted)
java     2565  dos  536r   REG   8,17    29732     0 57809486 /home/dos/deploy/applinks-jira/temp/jar_cache5041452221772032513.tmp (deleted)
java     2565  dos  537r   REG   8,17   197860     0 57809487 /home/dos/deploy/applinks-jira/temp/jar_cache6047396568660382237.tmp (deleted)

Atlassian Support can investigate this further if the resolution does not work, in order to do so please provide the following to Atlassian Support.

  1. The file generated by lsof +L1 > open_files.txt.
    (warning) This command must be executed by the JIRA user, or a user who can view the files. For example if JIRA is running as root (which is not at all recommended), executing this command as jira will not show the open files.
  2. A heap dump taken at the time of the exception being thrown, as per Generating a Heap Dump.
  3. A JIRA application Support ZIP.
Last modified on Jul 29, 2021

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.