17.4 Configuring Java Memory Allocations

TheTomcat configuration file controls the amount of memory that Tomcat can allocate for Java. If you have installed your Identity Server on a machine with the recommended 4 GB of memory, you can modify two parameters in this file to improve performance under heavy load:

17.4.1 Modifying the Java Parameters on Linux

  1. Log in to the Identity Server as the root user.

  2. Open the Tomcat configuration file for editing.

    /opt/novell/nam/idp/conf/tomcat7.conf
    
  3. Find the following line in the file:

    JAVA_OPTS="-server -Xmx1024m -Xms512m -Xss128k -XX:+UseConcMarkSweepGC" 
    
  4. Replace the -Xmx value (the default is 1024) with 2048.

    This allows Java to use 2 GB of memory.

    NOTE: The free memory threshold calculation is done based on the -Xms parameter. Even if you have configured the -Xmx parameter to 2 GB limit, the system takes the -Xms value as the maximum heap memory for the threshold limit.

    It is therefore recommended to keep the -Xmx and -Xms values same. For more details on tuning the memory limit, see Performance and Sizing Guidelines

  5. Find the following line in the file:

    JAVA_OPTS="${JAVA_OPTS} -Dnids.freemem.threshold=10" 
    
  6. (Optional) Change the -Dnids.freemem.threshold value from 10 to a value between 5 and 15.

    This prevents user sessions from using up all the memory and ensures that there is free memory available so that the other internal Java processes can continue to function. When this threshold is reached, the user receives a 503 server busy message and a threshold error message is logged to the catalina.out file.

  7. Save your changes, then restart Tomcat.

  8. Copy the modified file to each Identity Server in the cluster, then restart Tomcat on each machine.

17.4.2 Modifying the Java Parameters on Windows

  1. Log in to the Identity Server as the administrator.

  2. Open the Tomcat configuration utility.

    Windows Server 2008: /Program Files (x86)/Novell/Tomcat/bin/tomcat7w.exe

  3. Click the Java tab.

  4. In the Java options section, find the following line:

    -Dnids.freemem.threshold=0 
    

    If the line does not exist, you need to add it.

  5. Change the -Dnids.freemem.threshold value from 0 to a value between 5 and 15.

    This prevents user sessions from using up all the memory and ensures that there is free memory available so that the other internal Java processes can continue to function. When this threshold is reached, the user receives a 503 server busy message and a threshold error message is logged to the stdout.log file.

  6. Change the Maximum memory pool size to 2048.

    This allows Java to use 2 GB of memory.

  7. Save your changes, then restart Tomcat.

  8. Repeat these steps for each Identity Server in your cluster.