Wednesday, January 5, 2022

JVM Architecture - Part -3

JVM Architecture - Part -3


This is continuation to part 1 and part 2.

1.    Execution Engine

Execution Engine has the following components

1.     Interpreter

2.     JIT compiler

3.     Hotspot profiler

4.     Garbage Collector



Interpreter

Once the data area is loaded with the instruction to be executed, java interpreter takes the byte code from there and finds out what native operation has to be performed and executes it. Native operations by interpreter are done by using Native Method Interface which uses the Native Method libraries that are present in the JVM.

Jre/bin folder has a lot of dll files. Those are the platform specific native dlls that is used by the interpreter.

JIT compiler

When a set of statements like in loop is keep getting executed repeatedly, then this wont be interpreted or converted to platform specific code everytime by the interpreter

Instead of this, JIT compiler comes into picture, compiles these repeated instructions and keeps ready the target platform code. No more interpretation required for that set of instructions. Its only the execution is required.

Hotspot profiler

Hotspot profiles always looks at how the execution is going on.

For example, if some set of statements are being executed repeatedly Hotspot profiler finds it out and it helps JIT compiler comes in place to speed up the execution.

Garbage Collector

This is responsible for cleaning up unused objects in memory areas.

No comments:

Post a Comment

Difference between Procedure Oriented Programming System and Object Oriented Programming System (POPS vs OOPS)

POPS vs OOPS   Today we will get to know the difference between Procedure oriented Programming system (POPS) and  Object-Oriented  Programmi...