Sunday, June 22, 2014

JAVA Virtual Machine (JVM)

sun java virtual machine | microsoft java virtual machine | java virtual machine specification

The JVM (java virtual machine) is a platform independent engine use to run java application. Sometime it is called virtual machine which is capable of executing java bytecode. Or we can say that Java Virtual Machine forms a layer between the operating system and the java program. When Java Virtual Machine invoke with a particular class file, the Java Virtual Machine loads the file, goes through a verification process and execute the instruction in that class file.
JVM for different platforms uses different technique to execute the bytecode. The major components of Java Virtual Machine are as follow:
  • Class loader
  • Execution engine
  • JIT (Just In Time) compiler
Class Loader: - The class loader loads the class dynamically, which are required by a program running in the memory.  Java Virtual Machine have following type of class loader: -
  • Primordial class loader: - Primordial class loader loads the Java API (application programming interface) classes required by the running java program.
  • Class loader objects: - Class loader objects loads the classes of the java application program. An application can create class loaders at runtime for loading the classes of the application.
Execution Engine: - Execution engine is the component of the Java Virtual Machine that runs the bytecode one line after another. Different vendors use different technique to implement the execution engine. The java execution engine converts the bytecode to the machine object code and run it.
JIT compiler: - the JIT (Just In Time) compiler is used for compiling the bytecode into executable code. The Java Virtual Machine runs the Just In Time compiler code without interpreting because the Just In Time compiler code is in the machine code format. Running the Just In Time- compiled code is faster than running the interpreted code because it is compiled and does not require to be run, line after line.

No comments:

Post a Comment