Tuesday, March 07, 2006

Thread dump - Tips

Thread dump - ResinWiki

One of the most valuable features the Java Virtual Machine has is that you can get a stack dump of what it's doing at any particular moment.

This means that if your server appears to be hung, or is taking forever to process something, you can figure out exactly what it's doing.

This feature alone means that you don't need to spend your time logging your progress, as you can quickly get a snapshot of what's going on.

The only problem with getting a stacktrace is that it's a highly OS depdendent activity. The above link is nice because it shows you a bunch of different ways to get this information.

I'm pleased because I can now get a stack trace out of a cygwin based JVM. This is no simple task.

If you don't use stack traces, and you program in Java, you are really missing out. Learn how to generate them, and learn how to read them. I promise you that the time you spend will be repaid many times over.

No comments:

Post a Comment