Using 'kill -3' method to generate stack traces produces "hotspot log" instead
search cancel

Using 'kill -3' method to generate stack traces produces "hotspot log" instead

book

Article ID: 294397

calendar_today

Updated On:

Products

VMware Tanzu Gemfire

Issue/Introduction

When using the kill -3 <pid> method to take thread dumps, the output file contains XML like the below instead:

<?xml version='1.0' encoding='UTF-8'?>
<hotspot_log version='160 1' process='7324' time_ms='1690837443531'>
<vm_version>
<name>
OpenJDK 64-Bit Server VM
</name>
<release>
11.0.19+7
</release>
...
 




Java thread dumps (or stack traces) are a powerful tool for diagnosing issues in Java applications. Although there are multiple methods to have a running Java process generate a stack trace, many of these require additional tools, such as jstack and jcmd that may not be available on all systems. In this case, it is also possible to tell the JVM to perform a thread dump by sending the JVM process a SIGQUIT (-3) with the kill command (i.e. kill -3 <pid>).

 

Environment

Product Version: 9.10

Resolution

The option, -XX:+LogVMOutput, causes the JVM to log various JVM information in an XML format before logging the actual stack trace. However, this frequently has issues and does not complete the output, leaving the produced XML incomplete and the stack traces never logged. Removing that option from the Java command line options should allow kill -3 <pid> to produce the intended stack traces.