What is JIT Compiler in Java ?
JIT is Compiler works at runtime for improving program execution.
Let's look the complete process of execution of java program :
When we compile a Java file, the Java compiler (javac) converts the source code into platform-independent bytecode.
When we execute this compiled code (.class file), the JVM's ClassLoader loads the bytecode into the method area.
Initially, the JVM starts interpreting the bytecode line by line.
At runtime, the JIT compiler identifies hotspots ( Hotspots are the areas of code which will need to execute frequently. ) and compiles them into optimized native machine code.
This native code is stored in memory. When these hotspots are encountered again, the JVM directly executes the compiled native code, bypassing interpretation, which significantly improves performance.