A03 - JVM Internal Architect
/*
1. JVM - [ Load dot class + Execute ]
2. class loader -- LLI
3. > L- BEA
> B - responsible to load the classes present rt.jar
> E - responsible to load the classes from extension class path.
> A - responsible to load the class for the application class path.
4. > L- VPR
> V - weather .class is generated by the valid compiler or not
> P - jvm allocate memory to the class level static variables and assign its default values.
> R - symbolic name is replaced by the original memory reference
5. > I- Load Original Value
6. Memory Area --MHSPN
> M - store .class file info and static variables
> H - store instance variable object and arrays
> S - store current running method and local variables
> P - hold address of the next executing instructions
> N - all native method call invoked
7. Execution Area -- I, JIT
> I - decode every statement or line in the code
> JIT - code complied when it is needed , not before runtime.
8. JNI - interface allowe java to interact with other language written code.
*/
JVM inner structure part-1
1. java file --conpile-- > dot class file(byte code)
2. jvm -3 module
a. Module-1 = loader:
1. Bootstrap Class Loader:
2. Extension Class Loader:
3. Application Class Loader:
class loader use above three for loading dot class fiel into memory area
= linking:
1. Verification: Ensures the correctness of the loaded class files.
2. Preparation: Allocates memory for class variables and initializes them with default values.
3. Resolution: Replaces symbolic references in the class with direct references.
= Initialization: Executes the class's static initializers and initialization blocks.
= static block execute, ststic variables default value replace by the given one
b. Module-2 = memory area
1. class level data load - method area
2. jvm create object of class in heap memory ( info of class saved in method)
3. array, instance variables also saved in heap momory.
c. Module-3 = execution engine
Class Loader Subsystem: Responsible for loading class files into memory.
Memory Area: This includes the method area, heap, stack, and program counter.
Execution Engine: It executes Java bytecode. It consists of the interpreter and the Just-In-Time (JIT) compiler.