IBM i Batch Jobs – Out Of Memory Java Error

  • Home
  • /
  • Blog
  • /
  • IBM i Batch Jobs – Out Of Memory Java Error

March 1, 2017

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"}

Start your
7-day free trial

Take This Course with ALL ACCESS

Unlock your Learning Potential with instant access to every course and all new courses as they are released.
 [ For Serious Software Developers only ]

IBM i Training For Technology Experts

New!

Successfully Work Remote 

 $ 129.00  $59.00

By adding new skills in information technology, employers will be confident that you have the necessary skills and tools needed to successfully work remotely

>

Snug CBD

 20% Discount

I have partnered with SNUG CBD givING you Organic CBD
20% discount code "NL20"