How to resolve OutOfMemoryError: Java heap space error.
search cancel

How to resolve OutOfMemoryError: Java heap space error.


Article ID: 44142


Updated On:


CA Identity Manager


We have seen below error message in the IM console and server.log. What should we do?

java.lang.OutOfMemoryError: Java heap space



CA Identity Manager


The error indicates that Java ran out of memory to allocate to the application resulting in anything from minor issues such as that activity having to wait to complete, to complete system outages. 


You will need to monitor the overall Java usage on the system and determine what peek usage is, then review the product documentation on increasing the JVM memory allocations:

Identity Manager 14.4 Performance Tuning:
Please note the Fine Tuning Garbage Collection link if you need to configure Jboss / Wildfly with more than 4gb of Memory. 
For example of a system running Wildfly 15, if it is determined that IDM needs around 6gb of memory to function and avoid out of memory errors we would want to set something like the following for the JVM in the standalone.conf.bat:

-Xms8g -Xmx8g -XX:+UseG1GC -XX:ConcGCThreads=12 -XX:ParallelGCThreads=22 
-XX:MaxGCPauseMillis=1000 -XX:InitiatingHeapOccupancyPercent=40 
-XX:G1HeapWastePercent=2 -XX:G1ReservePercent=15 
-XX:+UnlockExperimentalVMOptions -XX:G1OldCSetRegionThresholdPercent=15 
-XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=20 

This will set the memory allocation to a total of 8gb to allow for some growth and to absorb unusually high activity, as well as tuning the garbage collection to better cleanup this larger allocation of memory. 

Additional Information

We recommend that you set JVM debugging options so that you are alerted on out-of-memory conditions.
For more information about setting JVM debugging options, see Debugging Options in Java HotSpot VM Options at