News »Browse Articles »
How to Diagnose Java Resource Starvation
0
How to Diagnose Java Resource Starvation
The metaphor goes like this: There are three well-known philosophers in an Asian bistro. Dinner is served but they are only given three chopsticks because the restaurant`s supply truck has been stuck in a snow storm for a couple of days. Naturally each philosopher needs two chopsticks to eat his dinner and each is protected from interference while he uses a chopstick.
Plato skipped lunch that day and insists that he should have priority or else he`ll faint. If he doesn`t give up his chopsticks, the other philosophers won`t be able to eat and eventually they`ll starve. If Plato drops his chopsticks and immediately picks them up before the other philosophers can get them then they won`t be able to eat and they`ll eventually starve.
Dijkstra`s Dining Philosophers Problem employed spaghetti and forks but I used chopsticks and Asian cuisine for a more realistic illustration since you can`t eat spaghetti with a single chopstick
These are examples of resource starvation. You could also encounter deadlock. There are a couple of solutions like semaphores and monitors. But we won`t think about solutions or deadlocks in this article. We`ll focus on detecting resource starvation using IBM Thread and Monitor Dump Analyzer for Java.
What Is the IBM Thread and Monitor Dump Analyzer for Java?
During the runtime of a Java process, some Java Virtual Machines (JVMs) may not respond predictably and often seem to hang up for a long time or indefinitely (until the JVM shuts down). It`s sometimes very challenging to determine the root causes of these sorts of problems.
By triggering Java thread dumps or Javacores when a Java process doesn`t respond, it`s possible to collect diagnostic information related to the JVM and a Java application captured at a particular point during execution.
On some platforms, a Javacore is known as "javadump." The code that creates a Javacore is part of the JVM. One can control it by using environment variables and runtime switches. By default, a Javacore occurs when the JVM terminates unexpectedly. A Javacore can also be triggered by sending specific signals to the JVM. Although a Javacore or javadump can occur in Solaris JVMs, much of the content of the Javacore is added by IBM and, so, is present only in IBM JVMs.
IBM Thread and Monitor Dump Analyzer for Java analyzes thread dumps/Javacores and diagnoses monitor locks and thread activities to identify the root causes of hangs, deadlocks, and resource contention or monitor bottlenecks. It can analyze IBM, Solaris, and HP-UX Java thread dumps from Java Virtual Machine 1.3.1, 1.4.x, 5.0, and 6.0
More than three years ago, I created IBM Thread and Monitor Dump Analyzer for Java as a garage project and spent thousands of hours during weeknights, weekends, and vacations to provide my clients and colleagues with something that can help diagnose these problems easily, motivated by the same reasons as my other garage projects like IBM HeapAnalyzer, IBM Pattern Modeling and Analysis Tool, and IBM Performance Analyzer for Java for Windows. All the algorithms used have been filed with the U.S. Patent and Trademark Office.
The widgetry was introduced to the public about two years ago through alphaWorks where it`s been one of the top downloads for 30 consecutive months. It`s recorded 23,296 downloads so far and it`s been used by more than 14,600 companies, government agencies, research facilities, and universities worldwide (these statistics are good as of October 2008).
What Is a Thread Dump?
A Java thread dump is the one of the traces/dumps that JVM provides to help diagnosis a hang, deadlock, or monitor contention issue. It contains diagnostic information related to the JVM and a Java application captured at a point during execution. For example, the information can be a list of all the threads that run on a Java virtual machine. Usually thread dumps have more than just thread information. Thread dumps can produce information about the operating system, application environment, threads, stacks, locks, and memory. IBM Thread Dumps/Javacores provide much more information like core interface, data conversion/unicode, class, diagnosis, execution management/thread management, lock, execution engine, mixed mode interpreter, JIT (Just-in-Time compiler), storage/JVM heap, and hardware portability interface/extended hardware portability interface.
The contents and formats of Java thread dumps depend on the platform you`re running on and the JVM provider. ....
Source:
http://java.sys-con.com/node/921279
Search News
News Categories
What's the News?
Post a link to something interesting from another site, or submit your own original writing for the Java community to read.
Most Popular News
-
How to stand out from other Java/JEE Professionals?
Published about 14-01-2009 | Rated +3 -
10 reasons IT certification will be important in 2009
Published about 05-01-2009 | Rated +2 -
The 9 hottest skills for `09
Published about 02-01-2009 | Rated +1 -
New Features in Servlets 3.0
Published about 05-01-2009 | Rated +4
Most Recent User Submitted News
- Animated JavaFX meets the NetBeans platform
Published about 27-01-2009 | Rated 0 - Apple finally patches six-month-old Java bugs
Published about 03-07-2009 | Rated 0 - Flash on iPhone: Adobe Clears a Hurdle, But More Remain
Published about 12-10-2009 | Rated 0 - What is the access scope of a protected method?
Submitted by Balamurali | Rated 0







