Configuring the JVM for Windows services and .NET Web applications

Content Delivery Server Roles running as Windows services or .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 following Server Roles (running as Windows services or .NET Web applications) call a JVM:

On the Content Manager server:

  • Tridion Content Distributor Transport Service
  • Tridion Monitoring Service

On a Content Delivery server that uses IIS and/or .NET:

  • Tridion Cache Channel Service
  • Tridion Content Deployer
  • Any Server Role running as a .NET Web application
  • Tridion Monitoring Service

You configure the Java home directory and JRE version for all of these Server Roles in the registry.

In addition, each of these Server Roles has its own JVM. On a Content Manager Server, you can configure the JVM call switches for the Transport Service running on that machine (note that this also affects all other .NET Web applications and Windows services that call a JVM on that machine).

On a Content Delivery server, you can do the same as on the Content Manager server, or you can configure separate JVM settings for each Windows service or .NET Web application.

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 one or both of the following entries to this subkey:
    TRIDION_HOME (the SDL Tridion home directory)
    Each Windows service needs to know where to find certain SDL Tridion files to include in its classpath. See System classpath generation for details.
    If you specify a value for TRIDION_HOME, the Windows services will use that value as their starting point for finding files, rather than the value of the TRIDION_HOME environment variable. This is useful if you have Content Manager and Content Delivery installed on the same machine, and want to place the Content Delivery-related files in a different directory than the Content Manager.
    JREVersion (the version of the Java Runtime Engine)
    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
    If you specify a registry value for the JRE for one or all services, then that version will be used instead of the default one. The version 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. Alternatively, if you are on a Content Delivery server, you can configure JVM startup settings for a specific Windows service or .NET Web application (except for the Tridion Content Distributor Transport Service or the Tridion Monitoring Service). To do this, ensure the presence of a file called jvm.xml in the config\ subfolder of the Windows service or in the bin\config\ subfolder of the .NET Web application. You can copy the sample file jvm_sample.xml found in the folder Content Delivery\resources\configurations\ on the installation media and rename it to jvm.xml. The file has the following structure:
    <VirtualMachine>
    	<Options>
    		<Option Name="-NAME" Value="VALUE"/>
    	</Options>
    </VirtualMachine>

    where NAME is the JVM switch you wish to set, and VALUE is the value you want to specify for that switch. You can specify as many Option elements as you like, then save and close the file.

    You have configured settings for one Windows service or .NET Web application, which override any corresponding settings in the registry. You can repeat this step to configure JVM calls from other Windows services or .NET Web applications.
  5. If you used the registry editor, close it now.
  6. Stop and start all Content Delivery .NET services and Web applications affected by your changes, and restart IIS.

Results

When you now start a Content Delivery .NET service or Web application, Content Delivery applies the settings you specified.