Clean • Professional
The Java Virtual Machine (JVM) Architecture defines how Java code is loaded, verified, executed, and managed in memory. It consists of three core components:
_20251117_080230.png&w=3840&q=75)
This architecture ensures Java’s platform independence, automatic memory management, and high performance.
The Class Loader is responsible for loading Java classes into the JVM.
It loads .class (bytecode) files dynamically at runtime.

java.lang, java.util, etc.)jre/lib/ext/.class fileJVM divides memory into different runtime areas where methods, objects, references, and instructions are stored.
_20251117_080454.png&w=3840&q=75)
Stores class-level information:
MetaSpace (JDK 8+) grows dynamically → reduces OutOfMemory errors.
Stores:
Heap is divided into:
Managed by Garbage Collector.
Each thread has its own stack.
Stores:
Follows LIFO (Last In First Out).
Stores:
Address of the current instruction being executed
Every Java thread has its own PC register.
Used for:
The Execution Engine is responsible for executing the loaded bytecode.
1. Interpreter
2. JIT Compiler (Just-In-Time)
Output: Faster execution on the CPU.
3. Garbage Collector (GC)
Automatically cleans unused objects from Heap.
Uses algorithms like:
Improves memory efficiency and reduces leaks.
4. Native Method Interface (JNI)
Allows Java to interact with:
+-------------------------------+
| Class Loader |
+-------------------------------+
| Loading | Linking | Init
v
+-----------------------------------------------------+
| JVM Runtime Data Areas |
| |
| +------------+ +-------------------------------+ |
| | Method | | Heap | |
| | Area | | - Objects | |
| +------------+ | - Arrays | |
| +-------------------------------+ |
| +------------+ +-------------------------------+ |
| | JVM Stack | | PC Register | |
| +------------+ +-------------------------------+ |
| +------------+ |
| | Native | |
| | Stack | |
| +------------+ |
+-----------------------------------------------------+
|
v
+-----------------------+
| Execution Engine |
| Interpreter |
| JIT Compiler |
| Garbage Collector |
+-----------------------+
|
v
CPU / OS
Understanding JVM internals helps in: