An ESB Runtime handling large amounts of data, with the JAVA_MAX_MEM set properly in the setenv and setmem scripts, throws the following error:
java.lang.OutOfMemoryError: Java heap space error
The following are possible causes of this error:
ESB Runtime started as a service. This means the Java memory parameters set in the setenv and setmem scripts are ignored, because these files are not taken into account by the wrapper service.
Running as a service, Java memory options are set in the wrapper configuration file.
The default values in the wrapper configuration file might not be big enough for your use case.
Set the Java memory options in the wrapper configuration file as follows:
Navigate to your <RUNTIME-HOME>/etc/ folder and locate the file that ends with wrapper.conf.
Edit the wrapper.conf file, and find the following lines:
# Initial Java Heap Size (in MB) #wrapper.java.initmemory=3 # Maximum Java Heap Size (in MB) wrapper.java.maxmemory=512
To set the minimum memory, remove the # at the beginning of wrapper.java.initmemory, and increase the value.
Note: if you set these Java memory options to a value larger than 4096m, then the wrapper service defaults to 4096m. If you need to set them to a larger value, add the following two lines in the wrapper.conf file, under # JVM Parameters:
where n is the number of the additional parameters; typically look for the last entry and use n+1.
Comment the wrapper.java.initmemory and wrapper.java.maxmemory lines:
Save the file.
Restart Runtime for changes to take effect.