Route/bundles in ESB Runtime fail with 'java.lang.OutOfMemoryError: Java heap space error'

Problem Description

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

 

Root Cause

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.

 

Solution

Set the Java memory options in the wrapper configuration file as follows:

  1. Navigate to your <RUNTIME-HOME>/etc/ folder and locate the file that ends with wrapper.conf.

  2. 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
  3. 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:

    wrapper.java.additional.n=-Xms8192m
    wrapper.java.additional.n=-Xmx8192m

    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:

    #wrapper.java.initmemory=8192
    #wrapper.java.maxmemory=8192
  4. Save the file.

  5. Restart Runtime for changes to take effect.

Version history
Revision #:
7 of 7
Last update:
‎08-20-2019 12:21 PM
Updated by: