Thread Dumps in Glassfish
We have totally changed the way that Thread Dumps are collected in Glassfish. Forget everything about how it used to be done.
- You need not run the servers in native mode. The same procedure works in native and non-native mode
- Thread dumps are available for all 3 kinds of servers -- Domain Administration Servers, Node Agents and Server Instances
- The new behavior is totally automatic, you don't need to do anything other than send a signal to the JVM to trigger it.
How to Trigger a Thread Dump in Windows
- Get the PID of the server with jps.
- Run sendsignal giving it the PID of the server.
How to Trigger a Thread Dump in UNIX and Linux
- Get the PID of the server with jps.
- Run kill -3 PID
Where did my Thread Dump Go?
The Thread Dump is appended to a file named jvm.log in the same directory as the normal server logfile. E.g. /gf/domains/domain1/logs/jvm.logImportant: the jvm.log file is deleted every time the server is restarted. If you want to keep the contents you will need to copy the file.
You should also explain the "asadmin generate-jvm-report" and "jstack" commands. The work that you've done is important because "jstack" is NOT available in JAVA SE 5.0 on Windows!
Thanks!
Posted by Kedar on April 23, 2007 at 09:39 PM PDT #
Posted by William Louth on April 26, 2007 at 07:51 AM PDT #
Posted by Bhakti Mehta's Blog on May 25, 2007 at 01:09 PM PDT #
Posted by Alan on May 26, 2007 at 12:27 AM PDT #
That brings up a good question - What is a good way to backport good features of more recent JDK versions into previous versions? I know you guys do a great job of that, but still, we end up writing some code that becomes obsolete or invent hack (e.g. reflection, if we are run on more recent JDK). Is there a better suggestion? Another instance of this is java.net.IDN class that is available only in JDK 6. See: https://glassfish.dev.java.net/issues/show_bug.cgi?id=3371 for an interesting use case.
Posted by Kedar on July 26, 2007 at 12:10 AM PDT #