Okta Access Gateway Admin UI Displays Exceptions While Saving an Application and Backend Logs Show OutOfMemoryError
Last Updated:
Overview
Insufficient memory allocation for the Okta Access Gateway (OAG) Admin UI causes exceptions when saving an application. Increasing the memory limit from the management console resolves the issue.
The Admin UI displays an error when saving an application.
The backend logs display an out-of-memory error.
2023-11-15T07:04:35.000-08:00 localhost java.lang.OutOfMemoryError Java heap space 2023-11-15T07:04:36.000-08:00 localhost ACCESS_GATEWAY WEB_CONSOLE handleExceptions 2023-11-15T07:04:36.000-08:00 localhost org.springframework.web.util.NestedServletException Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Okta Access Gateway (OAG)
- Admin UI
Cause
The Admin UI requires additional memory when a large number of applications or policies exist. Okta throws an exception if the configured memory is insufficient.
Solution
How is the Okta Access Gateway Admin UI memory increased?
Increase the memory from the management console. The option displays a safe range for the memory increase.
How is the Admin UI memory manually increased?
NOTE: The recommended method to increase the Admin UI memory is via the management console, as it calculates a safe range that avoids impacting other services. If the range does not appear, increase the system memory first, then increase it again via the management console. Manually updating the range may result in an outage.
Manually increase the Admin UI memory temporarily by logging into the management console shell, validating the available memory, updating the configuration file, and restarting the admin service.
- Log in to the management console shell.
- Validate that the admin node has sufficient memory to allocate more by running the following command.
sudo free -h
- Create a backup and update the xmx value in the configuration file. For example, update the value from
-Xmx256mto-Xmx1024m. Ensure the allocated memory is not too large to prevent an outage.sudo cp /opt/oag/services/admin/spg-admin.conf /opt/oag/services/admin/spg-admin.conf_backup sudo vi /opt/oag/services/admin/spg-admin.conf
- Restart the admin service for the changes to take effect.
sudo systemctl restart oag-admin
- Check the service status to reveal the updated value. If issues occur, revert the xmx value changed in step 3 to the original value.
sudo systemctl status oag-admin
oag-admin.service - Access Gateway Web Console Loaded: loaded (/usr/lib/systemd/system/oag-admin.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2023-11-15 08:56:30 PST; 23min ago Process: 33532 ExecStopPost=/opt/oag/bin/serviceLog.sh oag-admin stop (code=exited, status=0/SUCCESS) Process: 33499 ExecStop=/opt/oag/services/admin/spg-admin.jar stop (code=exited, status=0/SUCCESS) Process: 33560 ExecStart=/opt/oag/services/admin/spg-admin.jar start (code=exited, status=0/SUCCESS) Process: 33546 ExecStartPre=/opt/oag/bin/serviceLog.sh oag-admin start (code=exited, status=0/SUCCESS) Main PID: 33583 (java) Tasks: 45 (limit: 101000) Memory: 867.0M CGroup: /system.slice/oag-admin.service └─33583 /usr/bin/java -Dsun.misc.URLClassPath.disableJarChecking=true -server -Xmx1024m -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -Dlogging.config=/opt/oag/services/admin/config/logback.xml -Dh2.bindAddress=localhost -jar /opt/oag/services/admin/spg-admin.jar --spring.config.location=file:/opt/oag/services/admin/config/,file:/opt/oag/services/admin/config/spgw-key.properties,file:/opt/oag/services/admin/config/application-upgradable.properties
