Skip to content

JVM Architecture

Rohit Agarwal edited this page Jan 14, 2018 · 17 revisions

Virtual Machine

it is a software simulation of a machine which can perform operations like a physical machine. There are two type of virtual machines.

  1. Hardware based or system based - It provides several logical systems on the same computer with strong isolation from each other. That is on one physical machine we are defining multiple logical machines. The main advantage of hardware based virtual machines is hardware resources sharing and improve utilization of hardware resources.
    Example - KVM(Kernal based virtual machine for linux systems), VMWARE, XEN, Cloud computing

  2. Application based or process based - These virtual machines acts as runtime engines to run a particular programming language applications.
    Example -

    • JVM(Java virtual machine) acts as runtime engine to run java based applications.
    • PVM(Parallel virtual machine) acts as runtime engine to run perl based applications.
    • CLR(Common language runtime) acts as runtime engine to run .NET based applications.

Note - JVM is the part of JRE(part of JDK) and it is responsible to load and run java class files.

Basic Architecture diagram of JVM

Class loader subsystem is responsible for the following three activities.

  1. Loading
  2. Linking
  3. Initialization

Loading

Loading means reading class files and store corresponding binary data in method area. For each class file JVM will store corresponding information in the method area.

  • Fully qualified name of class
  • Fully qualified name of immediate parent class
  • Methods information
  • Variables information
  • Constructors information
  • Modifier information
  • Constant pool information etc

After loading .class file immediately JVM creates an object for that loaded class in the heap memory of type java.lang.Class.

The class Class object can be used by programmer to get class level information like methods information, variables information, constructor information etc.

Clone this wiki locally