Jre & Jvm Notes
Jre & Jvm Notes
Java Architecture
Search and Components
5 min read · Mar 4, 2022
Listen Share
Are you Java Programmer? This blog helps you to understand every aspect of this
language. It is a must for the programmer to understand the language. The most
important aspect of Java is its architecture and also understand the components of
Java Virtual Machine(JVM).
The bytes codes are then converted into machine by the JVM
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 1/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Java Architecture
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 2/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
The below architecture depicts the architecture of the JVM. Let’s see the each
element in detail:
Components of JVM
Components of JVM
Class Loader Subsystem
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 4/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Class Loader is a subsystem of the Java Virtual Machine loads class files. It is the
first component of the architecture as it loads the program so other tasks can take
place. It also links and initialize the class files. It has three components — Loading,
Linking and Initialization
Linking — The subsystem has a verifier to verify if the byte code is correct or not. It
generates the verification error if the byte code isn’t proper. The linking allocates all
static variables memory and assigns the default values and replaces the symbolic
references of memory with original ones.
Initialization — The system assigns the static variables to the original ones and
executes the static block.
Runtime Data Areas
Class Method Area -
Static Variables, Static Blocks, Static Methods, Instance Methods are stored in
this area.
Heap Area -
It stores all the objects and their instance arrays and variables.
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 5/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Stack Area -
It is a data area in the JVM memory which is created for a single execution
thread.
The JVM stack of a thread is used by the thread to store various elements i.e.;
local variables, partial results, and data for calling method and returns.
It creates unique runtime stacks for every thread and makes an entry for every
method call in the stack memory(knows as stock frame).
It is a Local Variable Array which is related to the method, operand stack and the
frame data, where all symbols related to the method remain stored.
The frame data maintains the catch block information unless there’s an
exception.
PC Registers -
Every thread has separate PC Registers which hold the address of the running
instructions.
Once an instruction has completed execution, the PC register updates itself with
the next one.
Note that method area and heap area are shared resources while the stack area is
not.
Execution Engine
The Execution Engine executes the bytecode. It reads and executes and has different
components:
Interpreter -
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 6/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
It has a significant drawback as when the system calls one method multiple
times, and it requires a new interpretation every time.
JIT Complier -
The JIT Compiler has the intermediate code generator for producing
intermediate code and the code optimizer for optimizing the same.
It also has a target code generator that produces the native doe and a profile that
finds hotspots.
It is enabled by default. The JIT compiler compiles the bytecode of that method
into machine code, compiling it “just in time” to run
The JIT Compiler doesn’t have the drawback the interpreter has.When the
Execution Engine finds repeated code, it uses the JIT Compiler instead of the
interpreter.
Garbage Collector -
It tracks each and every object available in the JVM heap space and removes
unwanted ones.
Garbage collector works in two simple steps known as Mark and Sweep:
Mark — it is where the garbage collector identifies which piece of memory is in use and
which are not
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 7/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Apart from these components the JVM also has the JNI (Java Native Interface) and
the Native Method Libraries.
Java Architecture
Follow
Responses (1)
Write a response
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 8/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Khanglediv
Jan 5, 2024
Symbolic references in java are used for locating code or data in a jar file
Reply
Devaraj Durairaj
Mar 4, 2022 67
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 9/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Devaraj Durairaj
Oct 6, 2022 3
Devaraj Durairaj
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 10/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Devaraj Durairaj
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 11/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Jayram Manale
Feb 16
GN
Introduction:
Jan 21
Pudari Madhavi
Jun 2 25 1
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 13/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Sanjay Singh
Feb 25 54
Rukmal Senavirathne
Feb 2
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 14/15
6/13/25, 7:36 PM Java Architecture and Components. Understanding of Java Architecture and… | by Devaraj Durairaj | Medium
Developersanchit
Jun 6 84
https://devaraj-durairaj.medium.com/java-architecture-and-components-febd83b3adfc 15/15