Bitbucket Server is not available due to "java.lang.OutOfMemoryError: unable to create new native thread"
Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.
A short time after starting Bitbucket Server, the application stops without any shutdown request.
The following appears in the
As of Bitbucket Server 5.x,
catalina.out will no longer exist. It will be written to
java.lang.OutOfMemoryError: unable to create new native thread
- Linux using systemd as the default init system
- For example, Ubuntu 15.10+ first introduced systemd as the default
- No other processes can be started on the server. For example running a
pscommand returns the following:
atlbitbucket@bitbucket:~$ ps -efH | grep java -bash: fork: retry: No child processes
UserTasksMax setting in systemd does not allow the creation of a sufficient number of threads.
This setting has a default of 512.
Increase the value of the
DefaultTasksMaxsetting by changing the relative line in the /etc/systemd/system.conf to provide a higher number (for example 12288):
- Restart Bitbucket Server for the change to take effect