OutOfMemoryError: Java heap space


Article ID: 131666


Updated On:


CA Privileged Access Manager - Cloakware Password Authority (PA) PAM SAFENET LUNA HSM CA Privileged Access Manager (PAM)


In Password Authority, we are getting the following error in the tomcat log:
 java.lang.OutOfMemoryError: Java heap space 
What can we do about it?


Password Authority 4.5.3


Check this environment variable in $CSPM_SERVER_HOME/cspmserver/bin/.cspmserver_tomcat 
JAVA_OPTS="-server -Xms256M -Xmx1024M " 

-Xmx is the maximum heap size, and the setting depends on the OS of the machine hosting the Password Authority Server application.

We have  tested Password Authority -Xmx settings here on a linux 64-bit OS, and went as high as 2900 MB for the -Xmx setting, and the limitation on linux was 3GB. 

On Solaris, you should be able to increase the max heap size up to at least 3GB, assuming Solaris is 64 bit running the 32-bit PA application. You could be conservative and try 2.5 GB to start.

Additional Information


"Why can't I get a larger heap with the 32-bit JVM? 

The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems.