Architecture

About

The Java Virtual Machine (JVM) follows a well-structured architecture that enables Java programs to be executed efficiently. It consists of various interconnected components, each responsible for handling different aspects of execution, memory management, and performance optimization.

Component

Description

ClassLoader

Loads Java bytecode into memory dynamically.

Method Area

Stores class metadata, constants, and static variables.

Heap

Stores all Java objects and instance variables.

Stack

Stores method execution frames and local variables.

PC Register

Stores the address of the next instruction.

Native Method Stack

Stores native method calls executed by JNI.

Interpreter

Reads and executes bytecode line-by-line.

JIT Compiler

Converts bytecode into optimized native machine code.

Garbage Collector

Reclaims unused memory automatically.

JNI (Java Native Interface)

Connects JVM with native code (C/C++).

Last updated