java.io.IOException: Map fail

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

Problem

Application receives OutOfMemoryErrors and may crash. The following error appears in the logs:

1 2 3 Caused by: java.lang.OutOfMemoryError: Map failed at sun.nio.ch.FileChannelImpl.map0(Native Method) at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:846)

Cause

The OS (Unix based) was preventing the application from using the amount of memory allocated for JAVA.

Resolution

Increase the memory usage for the user running the application:

Use sudo command, or switch user to root, and edit /etc/security/limits.conf

Specify the new soft and hard limit for the application user. For example, to set both limits to 64K for user atlbitbucket, you need to specify:

1 2 atlbitbucket soft nofile 65536 atlbitbucket hard nofile 65536

Another alternative is to allow unlimited memory usage for the user running the application with the following command. This will remove any limits to virtual memory for the application process.

ulimit -v unlimited

One of the ways to do this is to add the above line to the start-up script:

For instance in Fisheye, you would add it to $FishEye-installation-directory/bin/start.sh.

Updated on April 17, 2025

Still need help?

The Atlassian Community is here for you.