IBM Support

OutOfMemoryError: PermGen space errors in WebSphere Process Server (WPS) migration wizard

Troubleshooting


Problem

The WebSphere Process Server migration wizard seems to be unresponsive during post-migration steps and can end with an OutOfMemoryError: PermGen space error.

Symptom

The error can occur in the following post-migration scenarios.

  • During the post-migration steps, the WebSphere Process Server migration wizard hangs and seems to be unresponsive. The following error is logged in the WBIPostUpgrade trace file:
    [3/25/09 14:31:16:828 CET] 0000000a CommandMetada 3   Exception caught java.lang.OutOfMemoryError: PermGen space  

  • The migration wizard does not recover from the unresponsive state.

  • During the post-migration steps, the deployment manager fails during application migration and writes the following error to the WASPostUpgrade.<Dmgr_profile>.<timestamp>.log file:
      ADMA5113I: Activation plan created successfully.
      ADMA5011I: The cleanup of the temp directory for application MyApplication_v1_0_0App is complete.
      ADMA5013I: Application MISTFlow_v1_0_0App installed successfully.
      java.lang.OutOfMemoryError: PermGen space
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
  • During the cluster upgrade step using the WBIProfileUpgrade.ant script, out of memory errors might be reported by the ws_ant command. The error is written to the scripting client as follows:

    • [wsadmin] Permanent generation is full...
      [wsadmin] increase MaxPermSize (current capacity is set to: 88080384 bytes)
      [wsadmin] java.lang.OutOfMemoryError: PermGen space              

Cause

The migration wizard hangs during the post-migration steps because there is not enough permanent generation space in the Java™ heap. The default value is not always sufficient enough for the WBIPostUpgrade.sh and WASPostUpgrade.sh scripts to finish.


The deployment manager fails during application migration because the wsadmin script requires a larger Java heap size than the default value to handle the application installation tasks.

The default heap parameters that are specified inside the WBIProfileUpgrade.ant script are not sufficient enough for the successful execution.

Resolving The Problem

For WebSphere Process Server prior to V7.0

Before you migrate, adjust the Java heap parameters to avoid the errors that occur due to insufficient memory. Use the following procedure to increase the value of -XX:MaxPermSize to an appropriate value for the WBIPostUpgrade.sh and WASPostUpgrade.sh scripts.

  1. Confirm the java.lang.OutOfMemoryError: PermGen space error in the MigrationBackupDirectory/logs/WBIPostUpgrade.trace file.

  2. Exit the migration wizard.

  3. Make sure that the pre-migration steps have completed successfully by checking the MigrationBackupDirectory/logs/WBIPreMigrationSummary.log file.

  4. Make a backup copy of the WBIPostUpgrade.sh and WASPostUpgrade.sh scripts from the WPS_Installdir/bin directory.

  5. Using a text editor that is supported on UNIX-based operating systems, add -XX:MaxPermSize=128m to the Java command in both scripts to allow more permanent generation space for the Java heap. Each line must be terminated with a backslash ( \).


    "$JAVA_HOME/bin/java" \
    -Xbootclasspath/p:"$WAS_BOOTCLASSPATH" \
    $EXTRA_X_ARG \
    $CONSOLE_ENCODING \
    -DKeepProfileName=true \
    -Dcom.ibm.websphere.migration.serverRoot="$WAS_HOME" \
    -Dcom.ibm.websphere.migration.currentProfileLogLocation=
    "$USER_INSTALL_ROOT" \
    -Dws.ext.dirs="$WAS_EXT_DIRS" \
    -XX:MaxPermSize=128m \
    $WAS_LOGGING \                                      
    $EXTRA_D_ARG \
    -classpath "$WAS_CLASSPATH" ....

  6. Save the scripts.

  7. Run the WBIPostUpgrade.sh script with the appropriate options. For more information, refer to the WBIPostUpgrade.sh documentation link included in the "Related Information" section of this document.


Notes:
  • Use care when you edit the scripts; make sure to include the backslash as indicated.

  • Refer to the previous WBIPostMigrationSummary.log file for the options that you used in the migration wizard. You can use the same options.


Tune the Java parameters in the wsadmin.sh script, as follows.
  1. Confirm the java.lang.OutOfMemoryError: PermGen space error in the WASPostUpgrade.<Dmgr_profile>.<timestamp>.log file, which is located in the MigrationBackupDirectory/logs directory.

  2. Exit the migration wizard.

  3. Restore the deployment manager from the backup that was made before the migration started.


  4. Make a backup copy of the wsadmin.sh script, which is located in the InstallRoot/profiles/Dmgr_profile/bin/ directory.

  5. Using a text editor that is supported on UNIX-based operating systems, locate and modify the PERF_JVM_OPTIONS parameter in the the wsadmin.sh script as follows:

    PERF_JVM_OPTIONS="-Xms512m -Xmx2048m -XX:PermSize=256m
    -XX:MaxPermSize=1024m"


  6. Save the script.

  7. Restart the deployment manager migration.


If out-of-memory errors are observed when the WBIProfileUpgrade command is run during migration, complete the following steps:
  1. Navigate to the InstallRoot/util directory and locate the WBIProfileUpgrade.ant file. Make a backup of the ant script.

  2. Edit the ant script using a text editor that is supported on UNIX-based operating systems; locate and modify the following lines as indicated in bold font:

    For the Sun and HP-UX JDK:

    <condition property="wsadmin.jvmargs" value="-XX:MaxPermSize=512m -Xms256m" else="">
    ....
    </condition>

    <presetdef name="wsadmin">
       <wsadmin.autoconnected wasHome="${was.install.root}"    
      profileDir="${user.install.root}" user="${user}"
      password="${password}"
    jvmMaxMemory="1024m">
          <jvmarg line="${wsadmin.jvmargs}"/>
          ....

    For the IBM Software Development Kit (SDK):

    <presetdef name="wsadmin">
       <wsadmin.autoconnected wasHome="${was.install.root}"    
      profileDir="${user.install.root}" user="${user}"
      password="${password}"
    jvmMaxMemory="1024m">
          <jvmarg line="${wsadmin.jvmargs}"/>
          ...

For WebSphere Process Server V7.0

The BPMMigrateProfile.sh script has a pre-defined maximum heap size setting of 768 MB. This value might be insufficient in some migration scenarios.

The setting is specified as follows in the script:
PERF_JVM_OPTIONS="-Xms512m -Xmx768m -XX:PermSize=40m -XX:MaxPermSize=128m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass" ;;

Complete the following steps to set the -Xmx parameter to a higher value and resolve the OutOfMemory errors.
  1. Make a backup copy of the BPMMigrateProfile.sh script in the product_install_root/bin directory.

  2. Using a text editor that supports UNIX-based operating systems, open the BPMMigrateProfile.sh for editing.

  3. Adjust the -Xmx value as required by modifying the section of script as indicated previously.

  4. Save changes to the script.

  5. Run the BPMMigrateProfile.sh script again.

If out of memory errors are observed when the BPMProfileUpgrade command is running during migration, complete the following steps:
  1. Navigate to the InstallRoot/util directory and locate the BPMProfileUpgrade.ant file. Make a backup of the ant script.

  2. Edit the ant script using a text editor that is supported on UNIX-based operating systems; locate and modify the following lines as indicated in bold font:


For the Sun and HP-UX JDK:
<condition property="wsadmin.jvmargs" value="-XX:MaxPermSize=512m -Xms256m" else="">
....
</condition>

<presetdef name="wsadmin">
   <wsadmin.autoconnected wasHome="${was.install.root}"
  profileDir="${user.install.root}" user="${user}" password="${password}"
   jvmMaxMemory="1024m">
      <jvmarg line="${wsadmin.jvmargs}"/>
      ....

For the IBM SDK:
<presetdef name="wsadmin">
   <wsadmin.autoconnected wasHome="${was.install.root}"  
  profileDir="${user.install.root}" user="${user}" password="${password}"    
 
jvmMaxMemory="1024m">
      <jvmarg line="${wsadmin.jvmargs}"/>
      ...

If out-of-memory errors are observed in the deployment manager application migration phase, edit the wsadmin.sh script in a similar fashion as explained in WebSphere Process Server prior to Version 7.0

Note: The heap parameter values are examples based on typical environments. Tune the appropriate parameter values as required by your WebSphere Process Server environment and the size of the applications that you are migrating.

If you see these exceptions during migration, you might need to tune your application server Java™ virtual machines (JVM) after migration. It is recommended that you test your applications on a new version in the development environment and determine the JVM settings required for the applications to run appropriately. Testing applications in this way prior to migration can help you distinguish between configuration and application migration problems.

The heap parameters PermSize and MaxPermSize are applicable for the JDK for Sun and HP-UX only.

[{"Product":{"code":"SSQH9M","label":"WebSphere Process Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Migration","Platform":[{"code":"PF010","label":"HP-UX"},{"code":"PF027","label":"Solaris"}],"Version":"7.0;6.2;6.1.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21381113