Troubleshooting IG

This book provides information on troubleshooting various issues in IG including collecting useful troubleshooting information such as logs, heap dumps and stack traces.


How To
ForgeRock Identity Platform
ForgeRock Identity Cloud

How do I change the JVM heap size for IG (All versions)?

Last updated Jun 8, 2021

The purpose of this article is to provide information on changing the JVM heap size for IG when it is running in a web container. This article provides details for changing the JVM heap size on Linux®, Unix® and Windows® systems.


1 reader recommends this article

Changing the JVM heap size

Changing the JVM heap size can improve performance and reduce the time it takes to process HTTP requests and responses. You should try different heap sizes to see what impact it has to determine the best heap size for your setup. The information given here is specific to the Apache Tomcat™ web container; you should make similar changes in the configuration file specific to your web container if you use a different one.

IG 7  and later include a standalone Java® executable file that runs in a Container-less execution environment. To set the JVM heap size for IG in Standalone Mode, please see Configure Environment Variables and System Properties for further information.

Note

It is recommended that you set the minimum and maximum heap sizes to the same value for best performance. Otherwise, the JVM runs a full Garbage Collector (GC) cycle when increasing its heap, during which time it can pause ongoing operations for up to a few seconds. Generally, a smaller heap will increase the frequency at which the JVM GC executes but reduce the duration; similarly, a larger heap will reduce the frequency and increase the duration. When tuning the JVM heap, the goal is to strike a balance between frequency and duration to reduce the impact of the GC on the application.

On Unix® and Linux® systems:

You can set the JVM heap size by specifying CATALINA_OPTS settings in the setenv.sh file (typically located in the /tomcat/bin/ directory). If this file doesn't exist, you should create it in the same directory as the catalina.sh file (also typically located in the /tomcat/bin/ directory).

For example, to set the minimum and maximum heap sizes to 2GB, you would add the following line to the setenv.sh file and restart the web container:

export CATALINA_OPTS="$CATALINA_OPTS -Xms2048m -Xmx2048m"

On Microsoft® Windows® systems:

Providing you haven't installed Tomcat as a service, you can set the JVM heap size by specifying CATALINA_OPTS settings in the setenv.bat file (typically located in the /tomcat/bin/ directory). If this file doesn't exist, you should create it in the same directory as the catalina.bat file (also typically located in the /tomcat/bin/ directory).

For example, to set the minimum and maximum heap sizes to 2GB, you would add the following line to the setenv.bat file and restart the web container:

set CATALINA_OPTS=-Xms2048m -Xmx2048m

If you have installed Tomcat as a service on Windows, then you must use the GUI application to configure Tomcat services. This process refers to Tomcat 7, but will work for other versions by changing tomcat7w.exe in the command to match your version.

  1. Stop the Tomcat service.
  2. Navigate to \path\to\tomcat\bin\ from the command prompt:
  3. Enter the following command to display Tomcat Properties: tomcat7w.exe //ES//serviceNameWhere serviceName is the name of your Tomcat service.
  4. Navigate to the Java tab and complete the memory pool fields as follows: Initial memory pool: 2048 Maximum memory pool: 2048
  5. Restart the Tomcat service.

Alternatively, Windows system administrators may prefer to configure these options in the registry so that they may be configured via group policy. The initial memory pool and maximum memory pool values can be configured in the JvmMS and JvmMX properties under the following registry key for Tomcat 7:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\Tomcat7\Parameters\Java

See Also

Best practice for JVM Tuning with G1 GC

Best practice for JVM Tuning with CMS GC

How do I enable Garbage Collector (GC) Logging for IG (All versions)?

How do I collect JVM data for troubleshooting IG (All versions)?

How do I use the msnapshots script to capture information for troubleshooting IG (All versions)?

Tuning IG's JVM

Related Training

N/A

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.