DebuggingJITIssues

JIT problems manifest themselves in many ways. Often the problem is an absurd incorrect return value or expression evaluation, which can lead to a wide variety of symptoms. Intermittent issues are good JIT suspects. A JIT issue is always a JVM problem.

However, intermittent issues can be caused by other factors, such as race conditions or timing issues. The first step for analyzing intermittent issues is to run the program multiple times, to get a feeling for the frequency. Then the first step for debugging an issue where JIT involvement is suspected is to create a (small) test case, and run it with JIT forced on and with off. If JIT is implicated, it will fail with JIT on, and pass with JIT off.

Waiting for a JVM's JIT fix can be impractical, and switching JIT off completely may cause a severe reduction in performance. But it may be possible to analyze the problem and work around it, either in the source code, or by using tools of the JVM.

For instance, the IBM JVM provides tools for diagnosing JIT issues, described in the section "Diagnosing a JIT or AOT problem" here: http://pic.dhe.ibm.com/infocenter/java7sdk/v7r0/topic/com.ibm.java.zos.70.doc/diag/tools/jitpd_diagnose.html

Example

Below is an example of analysis as it might be applied to a problem in Derby. The details (file numbers, failing methods) have been invented.

0 ) Confirm it's JIT

1) Get a reliable small test case.

2) Iterate to get the problem to occur consistently.

3) Locate the failing method.

4) report the issue.

5) Work around the issue.

DebuggingDerbyJITIssues (last edited 2013-10-17 22:17:55 by MyrnavanLunteren)