jvm architecture

JVM (Java Virtual Machine)
       Java Virtual Machine is an abstract machine. It provides the runtime environment and executing java bytecode.  JVM uses different types of memories like class, Heap, Stack, Register, Native Method Stack. JVM is an Interpreter and platform dependent. The various types of class loaders used by JVM,
Bootstrap: Loads JDK internal classes and java.* packages
Extensions: It Loads jar files from JDK extensions directory 
System: Loads classes from system classpath.

Architecture of JVM:
jvm architecture in java with diagram
                                                                JVM architecture 

Class loader:  It is used to load the class files and it is the sub-system of JVM.

Method area: It is stored class structure.

Heap: It is runtime data area. Memory for all class instances (objects) and arrays are allocated.

Java stacks: It stores frames and stores local variables & partial results.

Program counter register:  It contains the address of the JVM currently executed.

Native method stacks:  Natives method stacks  contains all native methods used in the application. The non-java code is called native code.

Execution Engine: It is responsible for executing the program and contains two parts.
 1. Interpreter: It executes byte code when we execute commands.
 2. JIT(Just in time complier): It is converting byte code to executable code providing high performance. The java code will be executed both interpreter and JIT compiler simultaneously it reduces compilation time.


Main operations of JVM:
Loads code
Verifies code                              
Executes code and
Provide runtime environment


Interview question:
What is JVM?
What is mean by platform dependent?
Explain the internal operation of JVM?
Explain various types of class loaders used by JVM?
JVM is Interpreter or complier?

4 comments

Thanks for sharing the informative article.
Genesis Technologies is an IT company in Indore which provides the great quality of software services at very affordable rates.


EmoticonEmoticon