What is a JVM in Java?

0
67
What is a JVM in Java?

Java Virtual Machine (JVM)

A Java Virtual Machine is simply an abstract computing machine in a computer. The machine enables the computer to run and execute the Java program language and byte code. The JVM simply does an interpretation of compiled Java binary byte code for the processor so as to allow the computer perform java instructions. The machine is able to specify the length of instructions keyed in.

Notions for Java Virtual Machine

An implementation: the implementation in JVM is called Java Runtime Environment (JRE)

A specification: this notion is where the work of JVM is really specified. However, the implementation provider is very independent in choosing the algorithm and it is done by companies like Sun and others.

The Runtime Instance: this ensures that anytime a java command is prompted, the machine creates an instance immediately.

The Java Virtual Machine has operations to perform in it. They include; loading the codes, verifying the loaded codes, executes the commands and lastly it provides a runtime environment for the codes.

Definitions which are provided by the machine are setting the register, class file format, defining memory area, reporting of fatal error, and also garbage- collected heap among others.

Internal subsections of Java Virtual Machine

  • Heap: this is the data area for allocation of objects.
  • Class area: it does the storage of per-class structures like the data method and field, runtime constant pool and the code for the methods.
  • Java stacks: the subsection stores the frames and holds the partial results and local variables and significantly assists in return and invocation method.
  • Class loader: the sub system is used in loading the class files.
  • Execution Engine: the part is composed of Just-In-Time compiler, interpreter and virtual processor. It is used to read and execute the byte code stream instructions and improve the performance.
  • Program Counter Register: this has JVM address currently being executed.
  • Native Method Stack: it carries the native ways used in the application

LEAVE A REPLY

Please enter your comment!
Please enter your name here