From time to time, you may be asked by Support to provide a jstack heap dump. This article demonstrates how to get the jstack of a process in Windows and Linux.
The jstack command gives us a Java stack trace of Java threads for a given Java process, or core file or a remote debug server. For each Java frame, the full class name, method name, 'bci' (byte code index) and line number, if available, are printed.
There are 3 main processes that will be running when Analyze is up that we can get the jstack for:
- The web application server (Tomcat)
- The Analyze server
- The node container
Before getting the jstack, you'll need to get the PID. This is a process identifier; it's a unique number that identifies each running processes in an operating system.
ON WINDOWS SERVER
On Windows, Task Manager can be used to identify the PIDs of the Analyze processes that are running. The following examples show how to do this using the Task Manager "Details" tab.
Note: you may need to add the columns referenced below to the Task Manger view - do this by right clicking on a column header and choosing "Select Columns".
Web Application (Tomcat)
- Open "Task Manager" and navigate to the "Details" tab
- Sort the "Name" column alphabetically, and find "tomcat9.exe" in the list
- In the "Command line" column, check that the entry is sourced from the Analyze install (and is not associated to another application on the system)
- Note down the process ID from the PID column
The Analyze Server & Node Container
- Open "Task Manager" and navigate to the "Details" tab
- Sort the "Name" column alphabetically, and find "java.exe" in the list
- The Analyze Server is identified as the entry which includes "-classpath" in the "Command line" column
- The Node Container is identified as the entry which includes "-cp" in the "Command line" column
- In the "Command line" column, check that the entry is sourced from the Analyze install (and is not associated to another application on the system)
- Note down the relevant process ID from the PID column
Note: there could also be java processes in the list which represent individual nodes running within Analyze. In this case you cannot disambiguate between them and the Analyze Server, so take jstacks for each process and send all files.
Comments
0 comments
Please sign in to leave a comment.