# Deployment Maintenance Guide

# Java Virtual Machine Configuration

This appendix describes how to adjust JVM memory parameters and turn garbage collection logging on and off. Instructions below cover applications supported by AquaLogic Interaction and those standalone AquaLogic User Interaction products.

The standalone AquaLogic User Interaction products are:

- AquaLogic Interaction Analytics
- AquaLogic Interaction Automation Server
- AquaLogic Interaction Collaboration
- AquaLogic Interaction Document Repository
- AquaLogic Interaction Notification
- AquaLogic Interaction PTUpload
- AquaLogic Interaction Publisher
- AquaLogic Interaction Studio
- AquaLogic Interaction Workflow

## Java Memory Switches

The following are Java memory switches used to tune JVM garbage collection. Use these switches in conjunction with the instructions specific to your application server or AquaLogic User Interaction product.

- -Xloggc:<path/filename>

This switch turns on garbage collection logging for the JVM. Replace `<path/filename>` with the location where the garbage collection log should be generated.

- `-Xms` and`-Xmx`

These switches set the minimum (`-Xms`) and maximum (`-Xmx`) heap size for the JVM. The JVM adjusts heap size based on object usage and bounded by these two switches. Setting these switches to the same value increases predictability by removing the ability of the JVM to adjust the heap size.

Caution: | Fixing the heap size to a specific value requires special attention to memory tuning.

- `-XX:NewRatio`

This switch sets the ration of the young generation to the tenured generation. For example

    -XX:NewRatio=3

would mean that the tenured generation is 3x the size of the young generation, or, in other words, the young generation is one quarter of the heap and the tenured generation is three-quarters of the heap.

## Application Servers

### Tomcat 4.1.x

To update Java options for Tomcat 4.1.x on Windows:

1. Edit setenv.bat in the <TOMCAT_HOME>\bin directory.
2. Update the JVM memory switches in the line

    set JAVA_OPTS=

3. Save setenv.bat. Reinstall the Tomcat service.

Note: | The setenv.bat parameters are only loaded into the service settings during service creation.

### Tomcat 5.x

To update Java options for Tomcat 5.x on Windows:

1. Run <TOMCAT_HOME>\tomcat5w.exe
2. Click the Java tab.
3. Update the Java memory switches in the Java Options: box.
4. Click OK. Restart the Tomcat service.

### WebLogic 8.1

To update Java options for WebLogic 8.1:

1. Edit installservice.cmd in <BEA_HOME>/user/projects/domains/<domain name>.
2. Add JVM memory switches to the line

    set MEM_ARGS=

3. Reinstall the WebLogic service.

Note: | The `MEM_ARGS` parameter can also be updated in the startup script for the WebLogic domain.

## ALUI Standalone Products

### Analytics

To update Java options for the Analytics JVM:

1. Edit wrapper.conf in <PT_HOME>/ptanalytics/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the Analytics service.

### Automation Service

To update Java options for the Automation Service JVM:

1. Edit wrapper.conf in <PT_HOME/ptportal/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the Automation service.

### Collaboration

To update Java options for the Collaboration JVM:

1. Edit wrapper.conf in <PT_HOME>/ptcollab/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

3. Restart the Collaboration service.

### Document Repository

To update Java options for the Document Repository JVM:

1. Edit wrapper.conf in <PT_HOME>/ptdr/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the Document Repository service.

### Notification

To update Java options for the Notification JVM:

1. Edit wrapper.conf in <PT_HOME>/ptnotification/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the Notification service.

### PTUpload

To update Java options for the PTUpload JVM:

1. Edit wrapper.conf in <PT_HOME>/ptupload/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the PTUpload service.

### Publisher

To update Java options for the Publisher JVM:

1. Edit service.conf in <PT_HOME>/ptcs/<ver>/settings/config.
2. Add a new parameter or modify existing parameters in the section Java Additional Parameters.

For example, locate

# Java Additional Parameters
wrapper.java.additional.1=-Dprogram.name=cswfserver
wrapper.java.additional.2=-Djava.awt.headless=true
wrapper.java.additional.3=-Dplumtree.container.home=./../../../../../ptcs/6.2/container
wrapper.java.additional.4=-Dplumtree.container.logs=./../../../../../ptcs/6.2/logs
wrapper.java.additional.5=-Dorg.jboss.net.protocol.file.decodeFilePaths=true

and add the garbage collection logging parameter

    # Java Additional Parameters
    wrapper.java.additional.1=-Dprogram.name=cswfserver
    wrapper.java.additional.2=-Djava.awt.headless=true
    wrapper.java.additional.3=-Dplumtree.container.home=./../../../../../ptcs/6.2/container
    wrapper.java.additional.4=-Dplumtree.container.logs=./../../../../../ptcs/6.2/logs
    wrapper.java.additional.5=-Dorg.jboss.net.protocol.file.decodeFilePaths=true
    wrapper.java.additional.6=-Xloggc:c:\publishergclog

3. Restart the Publisher service.

Note: | Publisher and Workflow run on the same JVM. Garbage collection logging and memory tunings are for both services.

### Studio

To update Java options for the Studio JVM:

1. Edit wrapper.conf in <PT_HOME>/ptstudio/<ver>/settings/config.
2. Add or modify parameters in the section Additional -D Java Properties.

Note: | Java parameter numbers must be continuous and incremental, and are set in both wrapper_base.conf and wrapper.conf. Check both files to ensure added parameters use the next number in sequence.

Restart the Studio service.

### Workflow

Workflow runs on the same JVM as Publisher and does not require seperate tuning.