What is the name of the runtime optimization that compiles Java bytecode to native machine code?
Answer
Just-in-time (JIT) compilation
Answer
Just-in-time (JIT) compilation
The runtime optimization that compiles Java bytecode to native machine code is just-in-time (JIT) compilation.
A JVM can initially interpret bytecode, but it monitors execution and identifies frequently used methods or loops called “hot spots.” The JIT compiler then translates those sections into processor-specific machine instructions and stores them for faster reuse.
JIT compilation balances portability and speed. Java source is compiled into platform-independent bytecode, while the JVM performs runtime compilation for the particular CPU and operating system. Because compilation uses live profiling information, the JVM can apply optimizations such as method inlining and dead-code elimination.
JIT is commonly confused with ahead-of-time (AOT) compilation. AOT produces native code before execution, while JIT compiles during execution. Dynamic recompilation describes a behavior that may occur during JIT optimization, but it is not the standard name for the overall technique.
Source: Wikipedia · fact-checked Aug. 2026