Java Virtual Machine(JVM)
Role of JVM
JVM first identifies the operating system and processor of a computer and then converts byte code instructions into machine language instructions which are executed by micro processor.
Class loader sub system
ClassLoader subsystem does the following tasks:
- It loads .class file into memory(RAM).
- It verifies the byte code instructions of .class file.
- Then it allocates the required memory for the java program.
- The memory allocated by the classloader subsystem is called Runtime Data Areas.
The data runtime Data Areas are divided into following 5 parts.
- Method Area
These are the data area’s which contains code for methods,class code and variable code.
- Heap Area
Objects are created in heap memory.
- Java Stacks
These are the memory area’s where the methods are executed.Java stacks are derived into several frames and on each frame a separate method will be executed.
- PC registers
These are the memory area’s which contains memory address of the methods.If we have two methods then two 2 PC registers will be created.
- Native Method Stacks
These are the data area’s where ‘c’ and ‘c++’ functions are executed.
Native Method Interface
It is a program it loads native method libraries into JVM.
It converts byte code instructions into machine language instructions.