Execution Engine

This is a place where the converted byte code is running. The byte code itself consists with the 1-byte OpCode (Machine language instruction which specify how the operation should be performed.) and additional operands. Since the byte code is written by human-readable format the execution engine is responsible for converting in to the language that can be easily executed by the machine in JVM.
JVM consists with three parts as discussed in below.
- Interpreter
The responsibility of the interpreter is read the byte code instructions and execute them in sequentially. In order to do that java class file should be consists with the main method.
- JIT Compiler
This enhance the speed of compile time by improving the performances. In here, when the interpreter reads byte code instruction at the same time JIT Compiler starts to convert JVM instruction set to Operating System specific instructions.
- Garbage Collector
This removes all unused objects during run time and thereby free up the memory. Following use cases show two ways which garbage collector involves with.
First way:
Employee emp = new Employee();
emp = null;
Second way:
Employee emp1 = new Employee ();
Employee emp2 = new Employee ();
emp1 = emp2;
In the above case, emp1 is ready to go with garbage collector.
Hope you can get the better understanding on JVM-Execution Engine through this part. In the next article let’s discuss about the Data types used in JVM.
Stay Safe !!!
References: