Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Simplify section on using jstack tool. Add link to JDK documentation.

...

Getting a thread dump depends a lot on your environment. Please choose the section below that matches your environment best. The more universal and convenient options are presented first, while the more difficult ones or those for specific setups are provided later. Generally, you should start at the top of the list and work your way down until you find a technique that works for you.

If you are running Oracle (Sun) JDK

...

Oracle Sun's JDK (not the JRE) (formerly Sun JDK) since version 1.6 (and since 1.4 on *nix systems) ships with a program called jstack (or jstack.exe on Microsoft Windows) which will give you a thread dump on standard output. Pipe the output into a file and you have your thread dump. You will need the process id ("pid") of the process to dump. Use of the program jps (jps.exe on Microsoft Windows) can help you determine the pid of a specific Java process.

If you are on *NIX running Sun JDK

Sun provides jstack on *nix systems from version 1.4 onward. See the above tip if you have such an environnmentSee Tools page in JDK documentation for usage reference.

If you are running on *NIX

...