What does it mean for a java program to be JIT'ed and does it make the execution a lot more faster or are there bytecodes which are not JIT'ed?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There is two ways to disable the JIT
-Djava.compiler=NONE
or this will almost never compile anything
-XX:CompileThreshold=2000000000
or on IBM JVM
-nojit
Disabling the JIT can slow down your code a lot e.g. 50x but not always. If you spend most of your time doing IO or GUI updates you might find it makes little difference.
回答2:
For IBM the correct option is -Xnojit or -Xint
回答3:
From the doc,
-Xint
Runs the application in interpreted-only mode. Compilation to native code is disabled, and all bytecode is executed by the interpreter.
The java.compiler
system property is known by Compiler class before Java 9. In Java 9 it's marked as @Deprecated
.
回答4:
In HotSpot VM JIT compilation can be disabled with the option -XX:-UseCompiler
which skips compiler threads initialization.
It is true
by default:
product(bool, UseCompiler, true,
"Use Just-In-Time compilation")