JVM(Java Virtual Machine) internal architechture

What is JVM?(Java Virtual Machine)
JVM (java virtual Machine) is an abstract machine. JVM is responsible to execute The Java Program. JVM is a specification that provides runtime environment in which java bytecode can be executed.JVM is available for every Operating system.

JVM is Pltform dependent.

Class loaders available in jvm

The classloader is a subsystem Of JVM That is Responsble to load classes.That means classloader will load the .class files.

Types of classloaers in JVM

  1. Bootstrap class loader
  2. Extension classloader
  3. application classloader

Memory Areas available in jvm

  1. MethodArea
  2. HeapArea
  3. stackArea
  4. PcRegisters
  5. Native method stack

Method Area

Method Area will store class level data.class level data means,static variables,static methods. And also method area store constant pool,field information,method information.

Heap Area

Heap area will store Object level data.Object level data means instance variables,and instance methods will stored in Heap Area.

stack Area

Stack area will load local varialbles,operand stack.

PC Registers:

PC(Program Counters) are the registers,which contain memory address of the instructions of the methods.for example if there are 3 methods,3PC registers will used to track the instruction of the methods.

Native method stacks

Native methods are executed on native method stacks.to execute native method stacks we need native libraries like c/c++ libraries are arequired.These c/c++ hearder files are connected to jvm by a program ,called naïve method interface.

what is Execution Engine in jvm?

Execution engine contains interpreter and JIT(JustInTime) comiler,which are responsible to converting byte code instructions into machine code so the processor will execute them.
Interpreter:Interpreter is responsible to read ,interprete and execute Java program line by line.
>Jit Compiler: Jit Compiler is used to improve the performance of the system.jit JIT compiler is responsible if any method repeatedly required instead of interpreting every time just compile once into machine codenext time onwards directly we can use this method .JIT compiler concept is applicable to only for repeatedly required methods.

No comments:

Post a Comment