Heap dump and Thread dump requests may be made by Support or Engineering when attempting to diagnose a hanging Tomcat process in SDM. The following article discusses the method to collect the information.
Release : 17.x
1. Find the PID for the JAVA process.
To get the PID for Default Tomcat (CATALINA_BASE):
Option 1: "pdm_tomcat_nxd -c GETPID".
Option 2: Run the following command in CMD or Powershell: WMIC PROCESS WHERE "caption LIKE 'javaw.exe%' AND commandLine LIKE '%CATALINA_BASE\\temp%'" get ProcessID /format:list
To get the PID for REST Tomcat (CATALINA_BASE_REST):
Option 1: "pdm_tomcat_nxd -c GETPID -t REST".
Option 2: Run the following command in CMD or Powershell: WMIC PROCESS WHERE "caption LIKE 'javaw.exe%' AND commandLine LIKE '%CATALINA_BASE_REST\\temp%'" get ProcessID /format:list
To get the PID for Support Automation Tomcat (CATALINA_BASE_SA):
Option 1: "pdm_tomcat_nxd -c GETPID -t SA".
Option 2: Run the following command in CMD or Powershell: WMIC PROCESS WHERE "caption LIKE 'javaw.exe%' AND commandLine LIKE '%CATALINA_BASE_SA\\temp%'" get ProcessID /format:list
To get the PID for Visualizer Tomcat (CATALINA_BASE_VIZ):
Option 1: "pdm_tomcat_nxd -c GETPID -t VIZ".
Option 2: Run the following command in CMD or Powershell: WMIC PROCESS WHERE "caption LIKE 'javaw.exe%' AND commandLine LIKE '%CATALINA_BASE_VIZ\\temp%'" get ProcessID /format:list
To get the PID for Maileater
WMIC PROCESS WHERE "caption LIKE 'java.exe%' AND commandLine LIKE '%maileater%'" get ProcessID
To get the PID for mail_nxd
WMIC PROCESS WHERE "caption LIKE 'java.exe%' AND commandLine LIKE '%mail_nxd%'" get ProcessID
To get the PID for es_ebl
WMIC PROCESS WHERE "caption LIKE 'java.exe%' AND commandLine LIKE '%MajicLi%'" get ProcessID
2. Find a JDK/JRE on the local system where jstack.exe and jmap.exe exists. Example: C:\Program Files\CA\SC\JRE\11.0.3\bin
3. Via Command Prompt, go to the directory where to create the dump file, e.g NX_ROOT\log
3.1 Run the following command to create the heap dump:
<jdk/jre root>\bin\jmap -dump:format=b,file=heap_<process_name>pid<pid>.hprof <pid>
For example:
C:\PROGRA~2\CA\SERVIC~1\log>"C:\Program Files\CA\SC\JRE\11.0.3\bin\jmap" -dump:format=b,file=heap_maileater_pid5724.hprof 5724
Output file will be created in the current directory.
3.2 To collect the thread dump run the command:
<jdk/jre root>\bin\jstack <PID> > jstack.txt
For example:
Ex: C:\PROGRA~2\CA\SERVIC~1\log>"C:\Program Files\CA\SC\JRE\11.0.3\bin\jstack" 5724 > jstack.txt
Output file will be created in the current directory.