A thread dump is a file to which information about the threads running within a Java process are output.
This subsection describes how to collect a thread dump and discusses the jheapprof command.
To collect a thread dump:
installation-directory\psb\jdk\bin\jps -v |
3980 Program -Xms40m -Xmx256m |
installation-directory\psb\jdk\jre\bin\jheapprof -f -p 4616 |
We recommend that you collect around 10 thread dumps at an interval of 3 seconds. By collecting multiple thread dumps, you can check the method processes in chronological order to identify a process that is causing a processing slowdown or is not responding.
When you collect multiple thread dumps, make sure that output of one thread dump is completed before collecting a subsequent thread dump.
jheapprof [-i|-f] [-class class-name] [-explicit|-noexplicit] [-fullgc|-copygc|-nogc] -p process-ID
installation-directory\psb\jdk\jre\bin\
Value | Description |
---|---|
0 | Command terminated normally. |
1 | Command resulted in an error. |
2 | Termination of output processing for the Hitachi statistics by class was not received within the specified amount of time. |
No. | Error message | Description |
---|---|---|
1 | usage: jheapprof [-f|-i] [-class classname] [-explicit|-noexplicit] [-fullgc|-copygc|-nogc] [-garbage|-nogarbage] [-rootobjectinfo|-norootobjectinfo] [-rootobjectinfost size] -p process-id jheapprof | A specified command argument is invalid. |
2 | jheapprof: illegal option -- option | option specified in the jheapprof command is invalid. |
3 | process-ID: Now processing previous request, this request canceled | The process with the specified process-ID is currently outputting statistics by class. |
4 | 0: Not owner | A value of 0 is specified for the process-ID argument in the jheapprof command. |
5 | jheapprof: can't create work file at temporary directory, this request canceled | Because the user does not have permissions to reference or write the directory for temporary files, the user cannot output an extended thread dump with Hitachi statistics by class. The request to output an extended thread dump with Hitachi statistics by class is canceled. |
6 | jheapprof: can't get temporary directory, this request canceled | The directory for temporary files could not be retrieved, so the extended thread dump with Hitachi statistics by class could not be output. The request to output an extended thread dump with Hitachi statistics by class is canceled. |
7 | jheapprof: please delete name-of-file-whose-deletion-failed in full-path-of-file-whose-deletion-failed | The jheapprof command was unable to delete an internal file when it terminated. Delete the file at the indicated full path whose deletion failed. |
8 | jheapprof: unexpected error occurred: cause-of-error | An unexpected error occurred during execution of the jheapprof command. cause-of-error displays the reason for the error, such as the following:
|
9 | jheapprof: can't communicate with process process-ID | Communication could not be performed due to a communication error in the process with the specified process-ID, or there was no process with the specified process-ID. |
10 | process-ID: Timeout occurred. Java process not responding | Completion of Hitachi statistics by class output processing for the process with the specified process-ID was not received within the specified amount of time. |
jheapprof -p 8662 |
Force VM to output HitachiJavaHeapProfile: ? (y/n) |
Force VM to output HitachiJavaHeapProfile: ? (y/n)y |
Writing Java core to javacore8662.030806215140.txt... OK |