Thursday, March 26, 2015

JVM (Java Virtual Machine)

1- What is JVM

- JVM = Java Virtual Machine

It is software component that provide runtime environment for java byte code to be executed. JVM is available on many hardware and software platforms.
Its implementation is know as JRE (Java Runtime Environment) and when ever user write java command on the command prompt to run the java class, and instance of JVM is created.

It performs operation like Load code, Verifies Code, Execute Code.



Now Lets discuss about few main point on JVM Architecture:-





1) Classloader:

Load class in to this area so that it can be executed in JRE.

2) Class(Method) Area:

It store stores code for methods.

3) Heap:

It is the runtime data area in which objects are allocated.

4) Stack:

Java Stack stores reference variable.

5) Program Counter Register:

It contains the address of the Java virtual machine instruction currently being executed.

6) Native Method Stack:

It contains all the native methods used in the application.

7) Execution Engine:

It contains virtural processor, Interepreter that read our *.class byte file and JIT-Just-In-Time(JIT) compiler :- Actually this is used to improve the performace in JAVA. Our *.class byte code is fragmented into many small segment and all the similar component is compiled only once at run time. Compile means translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU.


No comments: