How to update the JVM configuration for a Windows service

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Purpose

Sometimes existing JVM arguments must be changed, and others must be added. This is usually done within the start script of the application, but when the application runs as a Windows Service, the argument must be set directly into the service configuration. For example, updating %JAVA_HOME% or enabling DEBUG logging at startup.

Solution

Open the service configuration window

How to open the service configuration from Bitbucket 5.x:

  1. Stop the service.
  2. In the "Windows Start Menu" find the "Configure Bitbucket Service" shortcut (this is a shortcut for the bservmgr.exe executable, including the service name argument E.g: //ES/AtlassianBitbucket)

  3. Update the configuration parameter(s) (see below) and click Apply
  4. Start the service

How to open the service configuration manually, for Bitbucket up to version 4.x, or for Elasticsearch:

  1. Stop the service.
  2. Find the "Short Name" of the Windows service in the Windows Services list. (Under service properties)
  3. Open a Command Prompt "with Administrative Rights".

  4. Find the service executable:

    1. For the Bitbucket service: It is located in the following directory <Bitbucket Server Installation Path>\bin

    2. For the Elasticsearch service: It is located in the following directory <Bitbucket Server Installation Path>\elasticsearch\bin

  5. Run ONE of the following commands:

    For Bitbucket Server up to version 4.14.5
    tomcat8w.exe //ES//%SERVICENAME%
    For Bitbucket Server version 5.0+
    bservmgr.exe //ES/%SERVICENAME%
    For Elasticsearch
    elasticsearch-service-mgr.exe //ES/%SERVICENAME%

    Replace %SERVICENAME% with the name of your service found earlier.

  6. Update the configuration parameter(s) (see below) and click Apply
  7. Start the service

Update the service configuration

  1. The JVM Windows service configuration window will open.
  2. Go to the Java tab and add/update the parameter(s) in the Java Options field:

    <ARGUMENT>="<value>"
  3. To configure the pre-installed version of JVM set the Java Virtual Machine to the right DLL file. 

    e.g. 
    C:\Program Files\Java\jdk1.8.0_162\jre\bin\server\jvm.dll
  4. Click Apply and then Start the service.

Last modified on Sep 4, 2019

Was this helpful?

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