Increase Java JVM Memory Heap Allocation
search cancel

Increase Java JVM Memory Heap Allocation

book

Article ID: 24814

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager

Issue/Introduction

In the pdm_tomcat.log, you might see something like this:

<date> <time> org.apache.catalina.startup.Catalina start
INFO: Server startup in [nnnnn] milliseconds
Exception in thread "http-nio-8080-Poller" Exception in thread "TCP_port-Read:rep_daemon:<servername>" java.lang.OutOfMemoryError: Java heap space

This document shows how to increase the JVM Java Heap Size memory allocation for Tomcat in CA Service Management Service Desk Manager

By default, CA Service Desk Manager (SDM) is configured with 512 MB(1024 if it is version 17.3+) for the JVM Heap Size (or Tomcat Memory configuration), and it is not an unusual need to increase this value per site requirements, such as higher web services loads.

The maximum recommended value for 17.3 is 2GB for an SDM app that has a sizable load of attachments and exports.

It is required to have the Tomcat process recycled so the changes can take effect. 

 

Environment

Service Desk Manager: All supported versions.

Windows and Unix/Linux type environments.

Applies to Advanced Availability (AA) and Conventional Environments

Resolution

Prior to changing the files, make a backup copy of NX_ROOT\NX.ENV and NX_ROOT\pdmconf\NX.env_nt.tpl.

Next, proceed as follows by running the following commands in a Admin Command Prompt on the SDM Server::

  1. Adjust the option in NX.ENV file 
    pdm_options_mgr -c -s JAVA_OPTIONS -v "-Djava.net.preferIPv4Stack=false -Xms64M -Xmx1024M" -a pdm_option.inst 
  2. Adjust the option in NX.env_nt.TPL file:
    pdm_options_mgr -c -s JAVA_OPTIONS -v "-Djava.net.preferIPv4Stack=false -Xms64M -Xmx1024M" -a pdm_option.inst -t

    Open the NX_ROOT/NX.env file in a text editor and validate the change was applied:
    @NX_JAVA_OPTIONS=-Djava.net.preferIPv4Stack=false -Xms64M -Xmx1024M
  3. Recycle the Tomcat service:
    pdm_tomcat_nxd -c stop

    pdm_tomcat_nxd -c status

    pdm_tomcat_nxd -c start

    pdm_tomcat_nxd -c status

    Validate the change was successful, by opening the NX_ROOT\log\stdlog.x and confirming the Tomcat startup shows the new number: "1024", by searching for "Starting SERVICEDESK Tomcat".

    For example:
    06/16 09:49:53.97 myserver pdm_tomcat 2644 SIGNIFICANT pdm_tomcat.c 1373 Starting SERVICEDESK Tomcat: 
    "C:\Program Files (x86)\CA\SC\JRE\1.7.0_10\bin\javaw" -Xrs
    -Djava.net.preferIPv4Stack=false -Xms64M -Xmx1024M
    -Djaas.config=C:\PROGRA~2\CA\SERVIC~1\add-ons\caflow\jaas.config
    -Djava.security.auth.login.config=C:\PROGRA~2\CA\SERVIC~1\add-ons\caflow\jaas.config
    -Djdbc.baseDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
    -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
    -Dsun.io.useCanonCaches=false -Djava.awt.headless=true -Djava.endorsed.dirs="C:\Program Files (x86)\CA\SC\tomcat\7.0.23"\common\endorsed
    -classpath "C:\Program Files (x86)\CA\SC\tomcat\7.0.23"\common\lib\tools.jar;"C:\Program Files (x86)\CA\SC\JRE\1.7.0_10"\lib\tools.jar;
    "C:\Program Files (x86)\CA\SC\tomcat\7.0.23"\bin\bootstrap.jar;"C:\Program Files (x86)\CA\SC\tomcat\7.0.23"\bin\tomcat-juli.jar;
    C:\PROGRA~2\CA\SERVIC~1\java\lib\sqljdbc.jar;C:\PROGRA~2\CA\SERVIC~1\java\lib\ojdbc14.jar
    -Dcatalina.base=C:\PROGRA~2\CA\SERVIC~1\bopcfg\www\CATALINA_BASE -Dcatalina.home="C:\Program Files (x86)\CA\SC\tomcat\7.0.23"
    -Djava.io.tmpdir=C:\PROGRA~2\CA\SERVIC~1\bopcfg\www\CATALINA_BASE\temp org.apache.catalina.startup.Bootstrap start
  4. Confirm you can successfully login to the Service Desk web interface through the Tomcat URL.

    For example:

    http://myserver:8080/CAisd/pdmweb.exe

Additional Information

Tomcat requires a contiguous, uninterrupted block of memory for heap allocations.  If you are unsuccessful in changing the memory allocation, please review the server setup and any other applications running in case there is a memory allocation conflict.

Unsuccessful memory allocation will present in the pdm_tomcat log with a message similar to:

Error occurred during initialization of VM
Could not reserve enough space for XXXX KB object heap

The following document describes how to increase the Java Virtual Memory heap size for Tomcat in CA Service Desk 17.3.x:

https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/ca-service-management/17-3/administering/administering-ca-service-desk-manager/ca-sdm-environment-promotion/ca-sdm-environment-promotion-limitations.html 

For AA installations, proceed as per document:

https://knowledge.broadcom.com/external/article/39873/best-practice-for-using-the-pdm_options_.html