JVM Architecture

On 15:30 by instance of java   
  •  As a programmer we develop a java application and when we compile a java program, the compiler will generate .class (dot class) file.
  •   The .class file contains byte code (Special java instructions).
  •  To execute a java program we take the help of JVM (java virtual machine) to the JVM we have to provide .class file as the input.
JVM Architecture

Class Loader Sub System:    

  • The class loader sub system will take a .class file as the input and performance the following operations.
  • The class loader sub system is responsible for loading the .class file (Byte code) into the JVM.
  • Before loading the Byte code into the JVM it will verify where there the Byte code is valid      or   not. This verification will be done by Byte code verifier.
  • If the Byte code is valid then the memory for the Byte code will be allocated in different areas.
  • The different areas into which the Byte code is loaded are called as Run Time Data Areas. The various run time data areas are.

    1)    Method Area: This Area can be used for storing all the class code and method code.

    2)    Heap Memory: This Area can be used for storing all the objects that are created.

    3)    Java Stack: This Area can be used for storing the information of the methods. That is under execution. The java stack can be considered as the combination of stack frames where every frame will contain the stat of a single method.

    4)    PC Register (program counter): This Register will contain address of the next instruction that have to be executed.

    5)    Java Native Stack: This area is used for storing non-java coding available in the application. The non-java code is called as native code.

  

Execution Engine: 

The Execution Engine is Responsible for executing the program and it contains two parts.

  1. Interpreter 
  2. JIT Compiler (just in time compiler)   

The java code will be executed by both interpreter and JIT compiler symanteniously which will reduce the execution time and them by providing high performance. The code that is executed by JIT compiler is called as HOTSPOTS (company).

Native Library: 

  • All the predefined programs required for executing the non-java code put to gather is called as Native Library.

Native Interface:

  • The Native Interface is responsible for loading the programs form the Native Library to the: JVM.  
  • To execute a java program the JVM requires some resources from the machine to get those resources the JVM has to communicate with the operating system (OS). That is available in the underline machine.   

Source: JVM Architecture

Post author

Dustin Gurley is an Designer, Developer, Artist, Instructor, Critical Theorist and Systems Engineer. He has an extensive background working professionally with 2D/2.5D/3D Motion Graphics, Compositing, Film, Video, Photography and client-side performance techniques as it pertains to web development. Dustin recently completed work on his Master of Fine Art degree in Motion Media Design (Motion Graphics) from the Savannah College of Art and Design. Prior to beginning his graduate work, Dustin obtained a Bachelor of Art degree in Communication Studies with a concentration in Broadcast and Emerging Media from the University of North Carolina at Wilmington. In addition to design and modeling, Dustin enjoys toying with his view camera, working with scratch film, authoring media related material and contributing to various industry conferences. When not in front of a computer, Dustin can be found with his wife, Regina Everett Gurley. The couple enjoys dividing their time between their home just outside of Raleigh, North Carolina and the beautiful North Carolina coast. Currently, Dustin serves as the Lead Instructor of Internet Technologies for Wake Technical Community College in Raleigh, North Carolina.