.st0{fill:#FFFFFF;}

IBM i Batch Jobs – Out Of Memory Java Error 

 March 1, 2017

By  NickLitten

Cause

The Java Heap size is not set high enough.

Resolving the problem

These steps help increase the JVM max heap size from the default of 1 GB.

Heap size specifies the amount of dynamic memory to be made available to the JVM code. For systems with less than 1 GB of physical memory, use a maximum heap size of 256 MB, and an initial heap size of 0 MB.

For systems with 2 GB memory, use a maximum heap size of 768 MB, and an initial heap size of 256 MB.

For larger systems (more than 2GB), use a maximum heap size of 1024 MB, and an initial heap size of 512 MB.

To set the maximum and initial heap size:

  1. In the IBM® WebSphere® Application Server administrative console, click Servers Application Servers.
  2. Select the application server you want to configure.
  3. In the Server Infrastructure area, select Java and Process Management.
  4. Click Process definition.
  5. In the Additional Properties area, select Java Virtual Machine.
  6. In the General Properties box, provide the following heap values:
    • Initial Heap Size
    • Maximum Heap Size
  7. Save your changes.
  8. Stop and restart WebSphere Application Server for your changes to take effect.

Can’t find the Setting?

Look under the “Web Performance Advisor” Tab:

IBM i Batch Jobs - Out Of Memory Java Error 1
IBM i Batch Jobs - Out Of Memory Java Error 2

No Web Access – How do we do this with Green Screen?

When it is not possible to change WebSphere Application Server (WAS) JVM heap size via WAS Admin console, the server.xml can be edited in order to increase the JVM maximum heap size. Follow the steps below:

  1. First make a backup copy of the current server.xml file. Navigate to the profile-root/config/cells/nodes/servers folder.
    By default: /install_root/profiles/<profile_name>/config/cells/<cellname>/nodes/<nodename>/servers/server1/server.xml 
    For example: /opt/IBM/WebSphere/AppServer/profiles/InfoSphere/config/cells/ibm123Node01Cell/nodes/ibm123Node01/servers/server1

  2. Search for the <processDefinitions> and <jvmEntries> tag at the end of the file. Then, update these parameters: “initialHeapSize=”1280″ maximumHeapSize=”2048” 

    For example, the server.xml should look something like this: 
    <jvmEntries xmi:id=”JavaVirtualMachine_1183122130078″ verboseModeClass=”false” verboseModeGarbageCollection=”true” verboseModeJNI=”false” initialHeapSize=”1280″ maximumHeapSize=”2048″ runHProf=”false” hprofArguments=”” debugMode=”false” debugArgs=”-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=7777″ genericJvmArguments=”-Xdisableexplicitgc -Djava.awt.headless=true -Xjit:{com/ibm/db2/jcc/*}(disableIdiomRecognition)”>
    </jvmEntries>

  3. Save the server.xml file and restart WebSphere.

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

I’m always looking for awesome input, feedback and critique!

>