jvm hotspot hs_err_pid.log file - unix1998/technical_notes GitHub Wiki

When a Java Virtual Machine (JVM) encounters a fatal error, it generates a file called a "HotSpot Error Log," typically named hs_err_pid<pid>.log, where <pid> is the process ID of the JVM. This file contains detailed information about the error, including the state of the JVM at the time of the crash, and is useful for diagnosing and debugging the issue.

The hs_err_pid<pid>.log file includes the following information:

  1. JVM version and configuration: Information about the version of the JVM and its configuration settings.
  2. Error type and message: A description of the error and any relevant messages.
  3. Thread details: Information about the thread that caused the crash, including its stack trace.
  4. Native frames: Details about the native code frames at the time of the crash.
  5. Heap and garbage collection details: Information about the state of the heap and garbage collection activities.
  6. System information: Details about the operating system, hardware, and environment in which the JVM was running.

This file is generated in the working directory of the JVM or in the location specified by the -XX:ErrorFile option if it has been set.

Example hs_err_pid<pid>.log Filename:

  • hs_err_pid1234.log where 1234 is the process ID of the JVM at the time of the crash.

Customizing the Error Log Location

You can customize the location and name of the error log file by using the -XX:ErrorFile JVM option. For example:

java -XX:ErrorFile=/path/to/logs/hs_err_pid%p.log -jar your-application.jar

In this example, %p will be replaced by the process ID of the JVM.

This error log is essential for troubleshooting and resolving issues related to JVM crashes.

⚠️ **GitHub.com Fallback** ⚠️