How can I collect Java Heap and Thread Dumps for Smart IT while troubleshooting stability or performance issues |
This knowledge article may contain information that does not apply to version 21.05 or later which runs in a container environment. Please refer to Article Number 000385088 for more information about troubleshooting BMC products in containers. While troubleshooting stability or performance issues of the Smart IT Application, BMC Support may request a customer to create Java Heap or Thread Dumps of Smart IT’s Tomcat server. Examples of situations where this information may be requested: Heap Dump: To analyze OutOfMemory errors in Tomcat logs (e.g. the Heap Memory usage may have a constant increasing trend, eventually leading to all available Heap space being used, resulting in OutOfMemory errors and the Application to stop functioning properly) Thread Dump: To analyze situations where either specific use cases are performing poorly, or there is a sudden general performance issue for the whole Smart IT Application (and where the performance issue cannot be explained by slowness of services that Smart IT depends on, i.e. AR Server, Smart IT DB, RSSO are found to be responding in a timely manner). In these situations, high CPU usage but stable memory consumption may be observed for the Tomcat process. The VisualVM application can be used to create such Java Heap and Thread Dumps. The suggestion would be to install this client on a separate (Windows) machine and connect from there to the target Smart IT Tomcat Server. To allow VisualVM to connect to Smart IT’s remote Java Virtual Machine (JVM), some additional parameters need to be configured for Tomcat. Instruction to obtain VisualVM and on how to configure Tomcat are provided below. Notes:
-XX:+HeapDumpOnOutOfMemoryError
This parameter would assure that an automatic heap dump is created when an OutOfMemoryError error is thrown. The heap dump can then be shared with Customer Support. Knowledge Article 000254961 shows where this parameter should be added. VisualVM client installation Option 1: The VisualVM tool comes bundled with Oracle Java Development Kit (JDK) 8. On a Windows system with the JDK installed, the VisualVM application can be started by double-clicking on the ‘jvisualvm.exe’ in your JDK bin folder. Note: Visual VM is no longer bundled with JDK versions after JDK 8.
Option 2: The VisualVM Tool can be downloaded as a standalone tool from the following location:
Preparing Smart IT’s Tomcat server to allow JMX connections The information below includes the basic setup to enable JMX connections (e.g. without authentication or ssl). While this may be sufficient in a local network where access is restricted, do consider if further security settings for JMX access should be enabled, especially in case the server/port can be accessed from remote locations (see also: Apache Tomcat Security Considerations). Find a free port on the Smart IT Server (port 9010 is used in the example below). Smart IT Server on Windows OS
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<ip_address_smt_server> Click ‘Apply’ and restart Tomcat
netstat -an | findstr 9010
Smart IT Server on Linux OS
export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=<ip_address_smt_server>"
netstat -an | grep 9010
Creating Heap and Thread Dumps using VisualVM
NOTE: Before taking a Heap dump, please confirm that sufficient free disk space is available on the Smart IT Server (as the size of the .hprof file can take up as much disk space as the configured maximum heap space).
Repeat the ‘Thread Dump’ step multiple times (suggestion is 5 times, with a 10 second interval) to generate multiple thread dumps. This will help identify trends in the thread utilization.
Note: Make sure the logs that are provided cover the full time frame of the test. In Debug mode, the smartit.log can fill up quickly – if this causes the full time frame not to be present in the smartit.log itself, check in the ‘YYYY-MM-weekX’ subfolders where back-ups are automatically created.
See also: BEST FAQ on Remedy for Smart IT Performance Issues |