Manage memory settings in RHSSO

Solution In Progress - Updated -

Environment

Red Hat Single Sign-On 7.2

Issue

Xmx & Xms parameters in Red Hat Single Sign-On use defaults values. If out of memory exceptions are found, those values should be modified.

Resolution

The JAVA_OPTS environment variable should be modified to fit the requirements.

Depending on the setup, the /opt/rh/rh-sso7/root/usr/share/keycloak/bin/standalone.conf or /opt/rh/rh-sso7/root/usr/share/keycloak/bin/domain.conf file should be modified adding a new line at the end of the file with the following content:

JAVA_OPTS="$JAVA_OPTS -Xms<size> -Xmx<size>"

For instance, to set those values to 10Gb:

JAVA_OPTS="$JAVA_OPTS -Xms10240m -Xmx10240m"

Or

JAVA_OPTS="$JAVA_OPTS -Xms10g -Xmx10g"

Notice the JAVA_OPTS variable include the previous JAVA_OPTS as this contains some other settings. The Xmx and Xms parameters will be duplicated but only the last value is used.

If using RPM as installation method, the service configuration contains some environment variables, but the startup configuration file takes precedence, therefore those files should be used.

If Red Hat Single Sign-On has been deployed in OpenShift the process is slightly different and it is documented in the following KCS

Root Cause

Red Hat Single Sign-On uses JBoss EAP underneath therefore the memory parameters should be modified for JBoss EAP.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments