Set heap size for Java on Bitbucket Server and Data Center
プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。
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.
*Fisheye および Crucible は除く
要約
Sometimes, you might need to change JVM parameters for heap size on Bitbucket (Xms and Xmx). To do this, edit the files and restart Bitbucket to apply the changes.
環境
Applies to Bitbucket on-premise installations on Windows and Linux environments.
ソリューション
Windows の場合
Take the following steps:
- Through the command line, go to the Bitbucket binary folder:
cd <Bitbucket Server installation directory>\bin
. - Access the Bitbucket process:
bservmgr.exe //ES//AtlassianBitbucket
. - In the pop-up window, select the Java tab and edit the Initial Memory Pool and Maximum Memory Pool values.
Linux の場合
Method 1 RECOMMENDED
Set and export the JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY environment variables at the OS level. This will preserve the set values that may otherwise be overwritten by Bitbucket upgrade activities.
方法 2
The following configuration changes will only affect currently installed Bitbucket version.
They will need to be re-applied after each upgrade.
- Through the command line, go to the Bitbucket binary folder:
cd <Bitbucket Server installation directory>/bin
. - Open the Bitbucket Webapp process:
vi _start-webapp.sh
. - Edit the JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY values.
# The following 2 settings control the minimum and maximum memory allocated to the Java virtual machine.
# For larger instances, the maximum amount will need to be increased.
#
if [ -z "${JVM_MINIMUM_MEMORY}" ]; then
JVM_MINIMUM_MEMORY=512m
fi
if [ -z "${JVM_MAXIMUM_MEMORY}" ]; then
JVM_MAXIMUM_MEMORY=1g
fi