JIT Compilation and Tiered Compilation
Learn how the JVM interprets then JIT-compiles hot methods and how to trigger and observe compilation.
Interpreter vs JIT
The JVM initially interprets bytecode. When a method is called frequently ("hot"), the JIT compiler compiles it to native machine code for much faster execution.
Tiered Compilation (Default Since Java 8)
Tiered compilation uses five tiers: T0 (interpreter), T1 (C1 simple), T2 (C1 limited profiling), T3 (C1 full profiling), T4 (C2 fully optimized). Methods move up tiers as they get hotter.
// Enable/disable tiered compilation:
// -XX:+TieredCompilation (default ON in Java 8+)
// -XX:-TieredCompilation (disables — only C2 used)All lessons in this course
- Class Loading Phases: Load, Link, Initialize
- ClassLoader Hierarchy and Custom Loaders
- Inspecting Bytecode with javap
- JIT Compilation and Tiered Compilation