Please follow these instructions to assist with the identification of the Java method associated with the JIT related issue.
1. For a crash during compilation, look for the line in the javacore that contains the string “Compiling method”. This is the method you will exclude.
1XHEXCPMODULE Compiling Method: java/lang/Math.max(II)I;
2. If the javacore from the crash does not contain the line above, it may have crashed in code already compiled by the JIT. Look for the current thread that was executing at the time of the crash. The method executing in the current thread will contain the string "Compiled Code".
4XESTACKTRACE at java/lang/Math.max(Math.max:314(Compiled Code))
3. For scenarios that do not have the above output, such as high CPU, enable JIT tracing.
-Xjit:verbose={compileStart|compileEnd},vlog=/tmp/jit.log
If you omit vlog, the output will go into the native_stderr.log.
Sample output
(warm) Compiling java/lang/Math.max(II)I t=122140
+ (hot) java/lang/Math.max(II)I @ 0x10C11DA4-0x10C11DDD
The last entries listed in the trace are the methods to consider for exclusion.
To exclude a Java method, include IBM Java -Xjit command line options for the application.
1. Excluding individual classes and methods will prevent the JIT from compiling code suspected of causing a JIT failure.
-Xjit:exclude={package/class.method}
2. Appending multiple classes and methods is allowed:
-Xjit:exclude={package1/class.method|package2/class.method}
3. Multiple exclude options can be used by using the comma separator:
-Xjit:exclude={package1/class.method},exclude={package2/class.method}
Examples:
a. The failing class and method is identified as java/lang/Math.max(II)I. To skip this method, add the following JVM argument:
-Xjit:exclude={java/lang/Math.max(II)I}
b. You can also use wildcards if the full method string is not known, or you want to target multiple methods:
-Xjit:exclude={java/lang/Math.max*}
For assistance with the configuration the -Xjit command line option, please refer to the:
IBM Java for AIX HowTo: Configure environment variables and command line options for Java based application servers
Note:
If, while starting the application, a syntax message is generated, enclose the complete -Xjit option in double quotes.
1. To narrow down the cause of the JIT failure, adjusting the compiling optimization can help. Setting noOpt disables all optimizations but still allows the JIT to compile the code.
-Xjit:optLevel=noOpt
-Xjit:{java/lang/Math.max*}(optLevel=noOpt)
2. The optimization list below is ordered from the most aggressive to the least expensive.
1. scorching
2. veryHot
3. hot
4. warm <-- Initial compiling usually occurs at this level
5. cold
6. noOpt
3. Adjusting the JIT threshold
Previously referred to as the MMI threshold, this determines when the JIT will perform compilation. Once the counter reaches 0, compilation will be executed and the counter will reset.
-Xjit:count=VALUE
By default, VALUE is set to 1000.
Setting VALUE to 0 means every method is compiled, and thread execution will wait until compilation is finished. This is called synchronous compilation mode.
-Xjit:count=0
-Xjit:exclude={java/lang/Math.max*}(count=0,optLevel=hot)
1. What is JIT?
JIT stands for Just-In-Time compiler. The purpose of JIT is to compile code that is most frequently used to speed up subsequent calls to those methods. Long running applications will have the most benefit using JIT.
2. When does code get compiled?
Classes or methods that are frequently called will be compiled with the JIT automatically. The more frequently a method is called, the more aggressive the optimization will be. Thread stacks in a javacore that list “ (Compiled Code)” are already compiled.
3. Is there a way to disable the Just-In-Time compiler?
Yes. Append one of the following to the generic JVM arguments.
-Xint
-Djava.compiler=NONE
In addition, the deprecated environment variable is still valid in IBM SDK 5.0 and 6.0, and can also be used to disable the JIT compiler:
JAVA_COMPILER=NONE
4. Can multiple options be combined in the same argument?
Yes. Here is the general syntax:
-Xjit:param,param=value,...
-Xjit:exclude={package/class.method}(param,param=value)...
-Xjit:{package/class.method}(param,param=value),...
Please note that using multiple -Xjit arguments are not recommended and will not be supported. Instead combine all into one -Xjit argument, separating each value using commas.
5. How do I use wildcards?
The wildcard character * can be used in either the package/class name or in the method name.
To skip all methods in the Math class:
-Xjit:exclude={java/lang/Math.*}
To skip all classes/methods in the java/lang package:
-Xjit:exclude={java/lang/*}
To skip all methods starting with “writeTo”:
-Xjit:exclude={com/ibm/mq/MQMsg2.writeTo*}
6. How do I stop JIT from compiling more aggressive optimizations if larger bytecode is produced?
Add the parameter disableInlining to the JIT parameters.
-Xjit:disableInlining
You can even use disableInlining, or any JIT parameter, on specific classes and/or methods.
-Xjit:{java/lang/Math.max(II)I}(disableInlining)
If, after reading and following the above instructions, further assistance is required, please complete the following steps:
1. Confirm that you have review and completed all of the above steps.
2. Contact IBM and open a new IBM service request (i.e., a new IBM PMR).
3. Collect and upload data as per the data collection procedures noted in the above sections or package and upload the current data and details by following the instructions on this web page:
IBM Java for AIX MustGather: How to upload diagnostic data and testcases to IBM
Document Type: | Technical Document |
Content Type: | General |
Hardware: | all Power |
Operating System: | all AIX Versions |
IBM Java: | all Java Versions |
Author(s): | Roger Leuckie |
Reviewer(s): | NA |