Identifying problems in the JavaTM platform is made easy by creating thread dumps. A thread dump contains a set of statements which help the system administrator to easily identify the problem in the program.
Creating a Thread Dump in Windows NT
Perform the following steps to create a thread dump:
To adjust the display setting:
Select the Command Prompt window where the program is running.
Click the uppermost left corner of the Command Prompt window. The drop-down menu is displayed.
Select the Properties option.
Select the Layout tab, and change the height value in Screen Buffer Size to 2000.
Click OK to save the change.
Press the Ctrl+Break keys. The thread dump is generated and displayed in the command window.
Scroll back in the command window until you reach the beginning of the dump "Full thread dump:"
Select all the text that follows "Full thread dump:"
Copy the text to any editor, and save the file.
Creating a thread dump in UNIX
There are two ways to create a thread dump on a Unix computer.
By copying the thread dump from your shell window
By redirecting the standard out (stdout) of the java command to a file. When you send a SIGQUIT signal to the java process, a thread dump is sent to the stdout.
In a shell, other than the shell where the program is running, find the java process ID using the ps command.
Send the java process a SIGQUIT signal:
|Note: If you are using KSH: The INT and QUIT signals for an invoked command are ignored if the command is followed by & and the monitor option is not active. In other words, you cannot get a thread dump of a process that is running in the background.|
If you are not using the SIGQUIT signal, scroll back to the beginning of the thread dump, copy and paste the thread dump to a file.