Sun. Dec 22nd, 2024

Class loader Subsystem

The class loader subsystem will take .class file as the input and performs the following operations.

a) It will load the .class file into the JVM’s memory.

b) Before loading the .class file, it will verify whether the byte code instructions are valid or not with the help of byte code verifier.

c) If the byte code instructions are valid then it will load a byte code instruction into different areas of the JVM called runtime data areas.

JVM Architecture

Runtime Data Areas

These areas are available at runtime to store different code. The various runtime data areas are:

1) Method Area:

This area can be used for storing all the class code along with their method code.

2) Heap:

This area can be used for storing the objects.

3) Java Stack:

This area can be used for storing the methods that are under execution. The java stack can be considered as a collection of frames, where each frame will contain the information of only one method.

4) PC (Program Counter) Register:

This register will contain the address of the next instruction that has to be executed.

5) Java Native Stack:

This area can be used for storing non-java code during the migration of the application from non java to java code. Non java code will be called as native code.

Execution Engine:

The execution engine is responsible for executing the java program. It contains two parts.

  1. Interpreter
  2. JIT(Just-In-Time) Compiler

Both the parts of the execution engine are responsible for executing the code parallely, reducing the execution time, and thereby improving the performance of application.

Note: The JIT compiler is designed by Hot Spot Technologies and the code executed by a JIT complier will be called as hot spots.

Library:

A library is collection of pre-defined programs of a language.

Native Libraries:

The collection of libraries of the non java languages will be together called as native libraries.

Native Interface:

The native interface will help to load the native code from native libraries into java native stack.

OS (Operating System):

To execute a java program the JVM requires some resources like memory, processor etc from the machine. To get those resources from the machine, the JVM has to communicate with the operating system.

By Rajashekar

I’m (Rajashekar) a core Android developer with complimenting skills as a web developer from India. I cherish taking up complex problems and turning them into beautiful interfaces. My love for decrypting the logic and structure of coding keeps me pushing towards writing elegant and proficient code, whether it is Android, PHP, Flutter or any other platforms. You would find me involved in cuisines, reading, travelling during my leisure hours.

Leave a Reply

Your email address will not be published. Required fields are marked *