Java / JVM Architecture (Java21) Interview questions
What are the types of JIT compilers in HotSpot JVM?
HotSpot ships two distinct JIT compilers, historically tied to the "client" and "server" JVM builds, though modern JVMs use both together.
| Compiler | Characteristics |
| C1 (Client) | Compiles quickly, applies lighter optimizations, favors fast warm-up. |
| C2 (Server) | Compiles slower, applies aggressive optimizations (inlining, loop unrolling, escape analysis), favors peak throughput. |
Rather than choosing one, modern HotSpot uses both together through tiered compilation: a method is first compiled quickly by C1, and if it keeps running hot, it is later recompiled more aggressively by C2.
More Related questions...