Java Virtual Machine
JVM-Java Virtual Machine is an abstract machine.It provides run time environment in which java bytecode can be executed.JVM is platform dependent.These are available for many software and hardware platforms because it is platform dependent.It performs the following tasks:
Internal Architecture Of JVM
JVM-Java Virtual Machine is an abstract machine.It provides run time environment in which java bytecode can be executed.JVM is platform dependent.These are available for many software and hardware platforms because it is platform dependent.It performs the following tasks:
- It Loads the code.
- It verifies the code.
- It executes the code.
- It provides run time environment.
Internal Architecture Of JVM
Class Loader
This is a subsystem of JVM that is used to load class files.
Class Area
This stores class structures such as runtime constant pool,field,and method data,code for methods etc.
Heap
It is the runtime data area in which objects are allocated.
Stack
It stores frames.It hold local variables and partial results.A new frame is created each time a method is invoked.A frame is destroyed when it's method invocation completes.
PC Register
Program Counter Register contains the address of JVM instruction currently being executed.
Native Method Stack
It contains all the native methods used in the application.
Execution Engine
It contains the following :
- Virtual Processor
- Interpreter - Read bytecode stream then execute the instruction.
- JIT Compiler - Just -In- Time compiler is used to improve the performance .It compiles parts of the byte code that have similar functionality at the same time and hence reduces the amount of time needed for compilation.