Jul 28, 2004

Detecting Deadlocks in Java...

Dr. Heinz M. Kabutz of Java Specialists has a new newsletter out today about detecting deadlocks in Java, and how there is an increased chance of having OutOfMemoryErrors in the precense of too many threads. Of course, the exact number here is dependent on many variables, so it is more of a random number than a static value.

Heinz presents some code for JDK5 (or tiger, or J2SE 1.5, or...) to detect the existence of deadlocks in an application, and provides a warning for when an application creates more than a certain number of threads. He uses a number of facilities that are presently not available in J2SE 1.4, but this definitely seems like something extremely useful when working with a multithreaded, server application as I am now.

Filed In