Admin UI shows the following error in UI while saving an application:
Out of memory error can be seen in backend logs as shown below:
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
- Okta Access Gateway
- Admin UI
Admin UI may need more memory when a large number of applications or policies have been configured. The service will throw an exception if the configured memory is not sufficient. In such cases, the configured limit needs to be increased from the management console.
Increase the memory from management console. The option will show a safe range up to which the memory can be increased.
The following steps can be used temporarily if a larger heap memory size is needed than what is showing up in the management console:
NOTE: The recommended way to increase the Admin UI memory is through the management console only since it calculates a safe range that will not impact any other service. If the range is not showing up, it is advisable to first increase the system memory and then increase it again using the management console, rather than manually updating the range, as this may result in an outage.
Steps to manually increase the Admin UI memory temporarily:
- Login to the management console shell.
- Validate that the admin node has sufficient memory to allocate more.
sudo free -h
- Create a backup and Update the xmx value in the following file. For example, update the value from -Xmx256m to -Xmx1024m. Make sure the allocated memory is not too large else it may create 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. In case of any issues revert the xmx value changed in step 3 to the original one.
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
