Tuesday 8, Apr 2025
We are moved to new domain
Click -> www.ehowtonow.com
Sunday, 1 October 2017

Introduction to Java Virtual Machine (JVM)

What is JVM

A Java virtual machine (JVM) is an abstract computing machine that enables a computer to run a Java program.

There are three notions of the JVM:
1. Specification
2. Implementation
3. Instance.
The specification is a document that formally describes what is required of a JVM implementation. Having a single specification ensures all implementations are inter-operable. A JVM implementation is a computer program that meets the requirements of the JVM specification. An instance of a JVM is an implementation running in a process that executes a computer program compiled into Java bytecode.

Java Runtime Environment (JRE)

Java Runtime Environment (JRE) is a software package that contains what is required to run a Java program. It includes a Java Virtual Machine implementation together with an implementation of the Java Class Library. The Oracle Corporation, which owns the Java trademark, distributes a Java Runtime environment with their Java Virtual Machine called HotSpot.

Java Development Kit (JDK)

Java Development Kit (JDK) is a superset of a JRE and contains tools for Java programmers, e.g. a javac compiler. The Java Development Kit is provided free of charge either by Oracle Corporation directly, or by the OpenJDK open source project, which is governed by Oracle.

What JVM does

The JVM performs following operation:

  • Loads code
  • Verifies code
  • Executes code
  • Provides runtime environment

JVM provides definitions for the:

  • Memory area
  • Class file format
  • Register set
  • Garbage-collected heap
  • Fatal error reporting etc.

Java Virtual Machine Architecture


1. Classloader : Classloader is a subsystem of JVM that is used to load class files.

2. Class(Method) Area : Class(Method) Area stores per-class structures such as the runtime constant pool, field and method data, the code for methods.

3. Heap : It is the runtime data area in which objects are allocated.

4. Stack : Java Stack stores frames.It holds local variables and partial results, and plays a part in method invocation and return.
Each thread has a private JVM stack, created at the same time as thread. A new frame is created each time a method is invoked. A frame is destroyed when its method invocation completes.

5. Program Counter Register : PC (program counter) register. It contains the address of the Java virtual machine instruction currently being executed.

6. Native Method Stack : It contains all the native methods used in the application.

7. Execution Engine : It contains:
  1. A virtual processor
  2. Interpreter: Read bytecode stream then execute the instructions.
  3. Just-In-Time(JIT) compiler

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer

Related Posts:

  • Java Overview Talk about Java technology seems to be everywhere, but what exactly is it? The following sections explain how Java technology is both a programming language and a platform, and provide an overview of what this technology can… Read More
  • Object-Oriented Programming Concepts Object-Oriented Programming (OOPs) Concepts Object Class Inheritance Polymorphism Abstraction Encapsulation Object Any entity that has state and behavior is known as an object. For example: table, keyboard, car etc. It … Read More
  • Lambda expressions are allowed only at source level 1.8 or above The "source compatibility" part of the Java Compiler dialog has to be 1.8. Otherwise even though you're allowed to use the library features of Java 1.8, you won't be able to use the language features. It's not just lambdas -… Read More
  • Hibernate Introduction Introduction Hibernate is a high-performance Object/Relational persistence and query service.The term Object/Relational mapping refers to the technique of mapping data and object model representation to relational data mod… Read More
  • Hibernate Architecture Overview The diagram below provides a high-level view of the Hibernate architecture: Minimal architecture The "minimal" architecture has the application manage its own JDBC connections and provide those connections to Hibernate;… Read More
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

3 comments:

  1. I am glad that part of this java tutorials corner. Educating free on java programming to the beginners is excellent.
    Thank you

    ReplyDelete
  2. Really a needy course for All computer aspirants.A great initiative. Thank you sir.

    ReplyDelete

Item Reviewed: Introduction to Java Virtual Machine (JVM) Rating: 5 Reviewed By: eHowToNow