Calculating Maximum Heap Size

A simple way to calculate the value for the -Xmx option is to use the figure for half the available memory on the system and divide that among the number of JVMs that both the application server and ENOVIA Live Collaboration Server (if used) are running. Using system commands, the number of JVMs can be counted manually; however, you should know how to calculate the number of Java processes (JVMs) that should be running since this could help track down any unwanted Java processes during troubleshooting. Read the installation guide that came with your application server, as it should include details of features, such as load balancing, that may add more JVMs than would normally be expected. Because these extra JVMs consume memory, they should be subtracted from the total available memory. One such JVM is the so-called "nanny process," which is described below.

Related Topics
Evaluation Details
Process Limitations
The Java Process Command Line

Starting with no applications running on the system, use the methods described in "Additional ENOVIA Live Collaboration Server Configuration Troubleshooting," Checking Memory Usage, to find the current amount of available memory. If a high degree of accuracy is required, take readings over several days, and calculate an average value. If the machine runs a backup program, find the amount of memory used by the backup program and subtract it from the amount of available memory. Now you will have determined the actual amount of available memory for the application and ENOVIA Live Collaboration Servers.

Calculating the maximum heap size involves a simple formula that requires knowing the number and type of JVMs that are to run on the machine. This number depends first on the whether RMI or RIP mode is used. The ENOVIA Live Collaboration Servers may or may not be running on the same server; if they are not, the number of JVMs equals the number of JVMs running in the application server. The number of Java processes in the application server depends on whether the server has one or more nanny processes. For example, WebSphere and WebLogic both have a nanny process, which is a monitoring process that requires at least 128M. Refer to your application server guide for information about nanny processes and whether they are used.

Note: The number of application server JVMs denotes the number of Java processes that are configured to support the ENOVIA Live Collaboration domain. If a second domain is running on the application server, the amount of available memory is affected by the memory consumed to run that domain and therefore should be subtracted from the current amount of memory to become the available memory figure used in the formulas below.

Note: If a nanny process is used, subtract 128m from the available memory before applying any of the formulas below.

Following are the formulas for maximum heap size:

RMI mode where the ENOVIA Live Collaboration Servers are not running on the same machine:

server JVM memory = available memory - 128m
maximum heap size = server JVM memory  / number of application server
JVMs / 2

Note: The number of application server JVMs is typically one per application server domain running on the machine.

RMI mode where ENOVIA Live Collaboration Servers are running on the same machine:

If there is more than one ENOVIA Live Collaboration Server, the RMI gateway is used. This is similar to an application server nanny process but is used to monitor and distribute the load for multiple ENOVIA Live Collaboration Servers. It requires 128M.

RMI mode with one ENOVIA Live Collaboration Server:

server JVM memory = available memory - 128m
per process memory = server JVM memory / (number of application server
JVMs + 1)
maximum heap size = per process memory / 2

RMI mode with more than one ENOVIA Live Collaboration Server:

server JVM memory = available memory - 128m
per process memory =  server JVM memory / (number of ENOVIA Live Collaboration Servers + number of application server JVMs)
maximum heap size = per process memory / 2

RIP mode:

server JVM memory = available memory - 128m
per process memory =  server JVM memory / (number of application server
JVMs)
maximum heap size = per process memory / 2

Note: In RIP mode, the ENOVIA Live Collaboration Server kernel shares the same process as the application server.