How to extract a thread dump from a java heap dump

Solution Verified - Updated

Environment

  • Java

Issue

  • We want to generate the thread dump when an OutOfMemoryError happens. Let us know if we need to set any jvm level parameter to generate thread dump on server crash.
  • Is it possible to get thread dump information from a heap dump?

Resolution

When using JDK 1.6, the thread information is embedded inside the heap dump. If you use a tool like Eclipse MAT (http://eclipse.org/mat), you can go to the Thread Overview and Thread Stacks reports to see the threads.

Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.