Documentation Center

Configuring the JVM for the legacy API (in-process) Server Role running in a .NET Web application

Server Roles running as microservices on a Windows machine or as .NET Web applications start a Java Virtual Machine (JVM). You can specify switches for these JVM calls. (To configure JVM calls from Java Web applications, refer to the documentation of your Java/JSP Web application server.)

About this task

The legacy API (in-process) Server Role (running in a .NET Web application), formerly called the API Server Role, calls a JVM:

You configure the Java home directory and JRE version for this Server Role in the registry.

Procedure

  1. To configure the Java home directory or the JRE version, do the following:
    1. Start a registry editor, for example, regedit.
    2. Depending on whether you use a 32-bit or a 64-bit operating system, check for the existence of a registry subkey Tridion in one of the following locations:
      • On a 32-bit system, search for this subkey in HKEY_LOCAL_MACHINE\SOFTWARE
      • On a 64-bit system, search for this subkey in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node

      If you cannot find this key, create it.

    3. In the HKEY_LOCAL_MACHINE\SOFTWARE\Tridion subkey, create a subkey called Content Delivery.
    4. In the HKEY_LOCAL_MACHINE\SOFTWARE\Tridion\Content Delivery subkey, create a subkey called General.
  2. You can now add a JREVersion entry (the version of the Java Runtime Engine) to this subkey.
    Setting the JREVersion is relevant if you have multiple versions of the Java Runtime Environment (JRE) installed. By default, Content Delivery sets the JRE version to whatever it finds as the value of the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime
    Environment\CurrentVersion
    Your JREVersion value overrides this default. The version you set must, of course, be installed on the server. To see which versions of the JRE are installed, look at the subkeys found in the following registry subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime
    Environment\

    Set the JREVersion entry to the name of one of the subkeys (that is, a valid version number such as "1.6" or "1.7"). If you fill in a version that is not installed, you cannot start the affected Windows services or .NET Web applications after you stop them.

  3. To configure the same JVM settings for all Windows services and .NET Web applications (whether Content Delivery-related or not) on the machine, create the key structure described above (if you have not done so already) and add entries to the HKEY_LOCAL_MACHINE\SOFTWARE\Tridion\Content Delivery\General subkey called jvmarg1, jvmarg2, jvmarg3 and so on, to represent JVM startup switches.

    By default, each Windows service or .NET Web application calls the JVM with its own default parameters. To add one parameter to your .NET services, create a registry entry jvmarg1 in the General subkey. To add two parameters, create two registry entries, jvmarg1 and jvmarg2, and so on. Give each registry entry the value of a JVM parameter, including an initial dash (-). For example, to set the maximum heap size to 256 MB, add a jvmarg1 registry entry and give it the value -Xmx256M.

    To extract startup log files from the .NET services and write them to a file in a folder location, specify a jvmargX entry (where X is a number) entry and set it to the value log=<fullpath>, where <fullpath> is the full path to a folder location. For example, a valid value could be log=D:\logfiles\services.

    Note the following:

    • If you supply a jvmargX registry entry that sets the classpath (that is, with a value that starts with -Djava.class.path or with -cp), the service will not work, because your classpath will override the default one set by the Windows service or .NET Web application itself.
    • You can see in Windows Event Viewer which startup options are applied, in the Tridion Content Manager category.
  4. Close the registry editor.
  5. Stop and start the legacy Server Role, and restart IIS.

Results

When you now start the legacy Server Role, Content Delivery applies the settings you specified.