javacore (Acquiring the thread dump/in Windows)
- Organization of this page
Format
javacore [-i|-f] -p process-ID
Function
Acquires the thread dump when executing the command. This command is for Windows.
Arguments
- -i
-
A message for confirming the execution of the thread dump output process is displayed. Enter y or n for the displayed message. In such cases, if you enter y, the thread dump is output and if you enter n, the process ends without performing any operation. If you omit this option, this option is enabled, when the -f option is not specified.
- -f
-
Disables the -i option. If you omit this option, the -i option is enabled.
- -p process-ID
-
In process-ID, specify the process ID of a Java program for acquiring the thread dump.
Return values
- 0:
-
The command is terminated normally.
- 1:
-
The command is terminated abnormally.
- 2:
-
A response of the thread dump output process termination was not received in a specified time.
Input example
-
Execute the javacore command by omitting the -f option.
% javacore -p 8326
-
A message for checking the execution of the thread dump output process is displayed.
Output a thread dump:?(y/n)
-
Enter y, when you want to output the thread dump and enter n, when you do not want to output the thread dump.
Output a thread dump:?(y/n)y
-
The running java program creates the following file in the current directory and continues the program.
- The thread dump
-
javacore process-ID.date-and-time.txt
Output messages
When the following error messages or warning messages are output, the thread dump is not acquired:
No. |
Error message |
Explanation |
---|---|---|
1 |
usage: javacore [-f|-i] -p process-id |
An argument of the command is invalid. |
2 |
javacore: illegal option -- option |
option specified in an argument of the command is invalid. |
3 |
javacore: can't communicate with process process-ID. |
A problem occurred in process-ID specified in an argument and hence the communication is not possible, or a process corresponding to process-ID specified in an argument does not exist. |
4 |
process-ID: Not owner |
0 has been specified in process-ID specified in an argument of the command. |
5 |
process-ID: Now processing previous request, this request canceled |
A process given in process-ID specified in an argument of the command is already running. |
6 |
javacore: can't create work file at temporary directory, this request canceled |
A reference permission and write permission is not assigned to the directory for temporary files. |
7 |
javacore: can't get temporary directory, this request canceled |
As GetTempPath()API returned an error, a directory for temporary files cannot be acquired. |
8 |
javacore: unexpected error occurred: error-cause |
An unexpected error occurred while executing a command. |
9 |
process-ID: Timeout occurred. Java process not responding. |
A response of the thread dump output process termination is not received within a specified time, from a process corresponding to process-ID specified in an argument of the command. |
10 |
javacore: please delete non-deleted-file-name in full-path-of-the-non-deleted-file. |
A file created in an internal process of the javacore command, when the command termination could not be deleted. Delete the non-deleted file in full-path-of-the-non-deleted-file. |
Notes
-
You cannot concurrently execute the javacore command for the same Java processes. Execute the command when the thread dump output process by the previous javacore command ends.
-
In the following cases, a message process-ID: Timeout occurred. Java process not responding. is sometimes output and the javacore command terminates.
-
When you execute the javacore command for a Java process for which the used memory size exceeds 1 Gigabyte
-
When you execute the javacore command when the system is highly loaded
Even if a message is output, if core.process-ID is created in the current directory of the target Java process and the file size increases gradually, you can consider that the process is normally performed. In such cases, do not stop the Java process.
-