JVM Architecture (Java Virtual Machine):
JVM is a platform-independent execution environment that converts Java byte code into machine language and executes it. Most of the programming languages source code is directly converts machine code that is designed to run on a specific microprocessor architecture or operating system, such as Windows or UNIX.
Various part of JVM architecture:- Class loader sub-system
- Various memory areas
- Execution Engine
Class loader sub-system:
Class loader sub-system is the responsible to load the class file into memory Class loader sub-system is classified into three,
- Loading
- Linking
- Initialization
- Bootstrap class loader: Bootstrap class loader is the responsible to load the class from bootstrap class path (rt.jar) . rt.jar contains all code java API classes.
- Extension class loader: Extension class loader is the responsible to load the extension class, that is classes present inside jdk/jar/lib/ext folder
- Application class loader: Application class loader is the responsible to load the classes from application level class path
- Verify: Verify is the process to verify the whether generated byte codes are proper or not, whether byte codes are generated by valid compiler or not. If verification is failed, verify error will be thrown.
- Prepare: In prepare process, memory will be allocated for static variables and assigned with default values.
- Resolve: In resolve process, all symbolic references are replaced with original memory area references
Various memory areas:
Memory areas are classified into five,- Method area
- Heap memory
- Stack area
- PC Registers
- Native Method stacks
- Local variable array: Local variable array will have the local variables and its values of a method
- Operand stack: Operand stack act as a workspace for an intermediate operations
- Frame data: All symbols which all are used in that method will be handled in Frame data
Execution Engine:
Execution Engine is the responsible to executes the program Execution Engine mainly classified as below,- Interpreter
- JIT compiler
- Garbage collector
- Java Native Interface (JNI)
- Intermediate code generator: Intermediate code generator is the responsible to produce as intermediate code
- Code optimiser: Code optimiser is the responsible to optimise the code
- Target Code generator: Target Code generator is the responsible to generate machine code or Native code
Most detailed explanation I've found on web! Will print it out!
ReplyDeleteThanks for your kind comment
DeleteThanks!
ReplyDeleteThanks and I have a super provide: Can You Hire Someone To Renovate A House house renovation budget
ReplyDelete