What is JVM and the Architecture of Java Virtual Machine?It is called Java Virtual Machine. It will compile & execute the java programming code. Converting the bytecode into machine code is the job of JVM. Learn JAVA Training in Chennai will lead you to get in-depth knowledge of Java. Let’s see how Java works internally.,
- Its a platform-dependent(Both software and hardware).
- JVM using an independent implementation provider to select the accurate algorithm for the execution.
- Oracle and few other companies will provide this implementation provider.
- Implementation means Java Runtime Environment.
- When we write the java code in the command prompt to rn the class, JVM will create the instance of the JVM class.
Working in JVMThe JVM performs the following works :
- Loading the Code
- Verifying the Code
- Executing the Code
- Replenishes runtime surroundings
- Classloader- It’s another subsystem in JVM. It is responsible for loading the code, linking the class library, and initialization of class files. It will store the.CLASS files into the JVM allocated memory space.
- Class Area(Methods or Functions)- It is an area to store the class objects, structures of the class, fields or arguments, and methods.
- Stack- Java Stack stores frames. It will keep the partial results of code compilation, locally assigned variables. When threads are created in the Java virtual machine, the own stack thread will be created simultaneously. When the method completes its process, the frame is automatically removed from the JVM stack. Get Java Online Course at FITA Academy by the educators in high-quality live interactive sessions.
- Native Method Stack- This is the stack that holds the native instruction from the JVM. It depends on the JVM native library. It may be communicated in other languages instead of using Java.
- Heap- It is a common memory space that is used in the run time of the program to store the objects, instances, variables, and arrays.
- Program Counter Register- It’s a kind of register that maintains the address of the currently working instruction in a Java virtual machine. Reach FITA Academy and gain advanced Java Training in Bangalore at a lower affordable cost.
- Execution Engine- Execution Engine contains the below
- A virtual processor
- Interpreter: Read bytecode stream then execute the instructions.
- Just-In-Time(JIT) compiler