A stack trace is a user-friendly snapshot of the threads and monitors in a Virtual Machine for the Java platform (Java Virtual Machine or JVMTM machine). A thread dump shows what every thread in a JVM is doing at a given time and is useful in debugging. When the application server freezes, hangs, or becomes sluggish for no apparent reason, you should generate and analyze a thread dump.
This section explains how to obtain a thread dump for GlassFish Server. More information about analyzing the information contained in a thread dump can be found in “An Introduction to Java Stack Traces” (http://java.sun.com/developer/technicalArticles/Programming/Stacktrace).