Permanent Fix for Heap Out of Memory Error When Deploying Maximo on WebSphere

This post will explain how to permanently fix the very common Heap Out of Memory error that occurs when deploying Maximo on WebSphere.

This error is often caused by the accumulation of files from old builds and deployments. Our solution will delete these unnecessary files every time we rebuild Maximo.

You may directly download the cleanup scripts but make sure to follow the instructions to modify your build files.

Procedure for Windows systems:

  • Create file cleanup.cmd in the Maximo deployment folder (typically C:\ibm\SMP\maximo\deployment) with the following content:
    @echo off
    rem -----------------------------------------
    rem Permanent Fix for Heap Out of Memory Error When Deploying Maximo on WebSphere
    rem Author: Kilian Cirera Sant
    rem See http://www.aktive.cat/blog/2015/01/permanent-fix-for-heap-out-of-memory-error-when-deploying-maximo-on-websphere
    rem Copyright 2015 Aktive Software & Consulting, S.L.
    rem http://www.aktive.cat/
    rem -----------------------------------------
    set WAS_PATH=C:\Program Files\IBM\WebSphere\AppServer
    set WAS_APPSRV=ctgAppSrv01
    set WAS_NODE=ctgNode01
    FOR /D %%p IN (""..\applications\maximo\maximouiweb\webmodule\webclient\javascript\dojo-2*"") DO rmdir ""%%p"" /s /q
    FOR /D %%p IN (""..\applications\maximo\maximouiweb\webmodule\webclient\javascript\tpae-2*"") DO rmdir ""%%p"" /s /q
    FOR /D %%p IN (""%WAS_PATH%\profiles\%WAS_APPSRV%\temp\%WAS_NODE%\*"") DO rmdir ""%%p"" /s /q
    FOR /D %%p IN (""%WAS_PATH%\profiles\%WAS_APPSRV%\wstemp\*"") DO rmdir ""%%p"" /s /q
    FOR /D %%p IN (""%WAS_PATH%\profiles\%WAS_APPSRV%\logs\MAX*"") DO rmdir ""%%p"" /s /q
    rmdir ""%WAS_PATH%\profiles\%WAS_APPSRV%\logs\MXServer"" /s /q
    rmdir ""%WAS_PATH%\profiles\%WAS_APPSRV%\logs\RMIRegistry"" /s /q
    rmdir ""%WAS_PATH%\profiles\%WAS_APPSRV%\logs\ffdc"" /s /q
  • Modify the lines that define WAS_PATH, WAS_APPSRV and WAS_NODE with the correct values for your installation.
  • Modify the build scripts buildmaximoear.cmd and buildmaximoearwas8.cmd by doing the same in both files:
    • Add the following line:
      call cleanup.cmd
    • Right after the line:
      set MAXIMO_PROPERTIES=maximo.properties

Procedure for Unix systems:

  • Create file cleanup.sh in the Maximo deployment folder (typically /opt/IBM/SMP/maximo/deployment) with the following content:
    #!/bin/bash
    # -----------------------------------------
    # Permanent Fix for Heap Out of Memory Error When Deploying Maximo on WebSphere
    # Author: Kilian Cirera Sant
    # See http://www.aktive.cat/blog/2015/01/permanent-fix-for-heap-out-of-memory-error-when-deploying-maximo-on-websphere
    # Copyright 2015 Aktive Software & Consulting, S.L.
    # http://www.aktive.cat/
    # -----------------------------------------
    WAS_PATH=/opt/IBM/WebSphere/AppServer
    WAS_APPSRV=ctgAppSrv01
    WAS_NODE=ctgNode01
    find ../applications/maximo/maximouiweb/webmodule/webclient/javascript -type d -name 'dojo-2*' -delete
    find ../applications/maximo/maximouiweb/webmodule/webclient/javascript -type d -name 'tpae-2*' -delete
    find $WAS_PATH/profiles/$WAS_APPSRV/temp/$WAS_NODE -type d -name '*' -delete
    find $WAS_PATH/profiles/$WAS_APPSRV/wstemp -type d -name '*' -delete
    find $WAS_PATH/profiles/$WAS_APPSRV/logs -type d -name 'max*' -delete
    rm -rf $WAS_PATH/profiles/$WAS_APPSRV/logs/MXServer
    rm -rf $WAS_PATH/profiles/$WAS_APPSRV/logs/RMIRegistry
    rm -rf $WAS_PATH/profiles/$WAS_APPSRV/logs/ffdc
  • Modify the lines that define WAS_PATH, WAS_APPSRV and WAS_NODE with the correct values for your installation.
  • Modify the build scripts buildmaximoear.cmd and buildmaximoearwas8.sh by doing the same in both files:
    • Add the following line:
      ./cleanup
    • Right after the line:
      export MAXIMO_PROPERTIES=maximo.properties

Next time you build Maximo, remember to first stop the application server and then run the build script (buildmaximoear or buildmaximoearwas8) normally. The Heap Out of Memory error should be gone.