SlideShare a Scribd company logo
1 of 25
Download to read offline
Java Virtual Machine
(JVM)
Virtual Machine
Virtual Machine : A simple software simulation of physical machine that is act like
physical machine but it doesn't have any physical existence.
Like : Calculator Software
Type of Virtual Machine :
1. Hardware based virtual Machine
2. Application Based or process processed virtual machine
Hardware Based Virtual Machine
When we create several logical system on the same computer with strong
isolation from each other so that is Hardware Based virtual Machine.
The main advantage of it is to utilization of our hardware .
Examples :
Cloud Computing
VMWare
KVM (Kernel Based Virtual machine )
Application Based Virtual Machine
These virtual machines acts as runtime engine to run a programming language
application.
Example
JVM : It is a runtime engine to run java application .
Java Virtual Machine
JVM is runtime engine to run java based application , it's part of JRE . JVM is
responsible for two activity to load and run java application .
JVM is divided into 3 components
1. Class Loader subsystem (To load .class file)
2. Memory area
3. Execution engine
Architecture
Class Loader Subsystem
Class Loader is responsible for three activity .
1. Loading
2. Linking
3. Initializing
1. Loading :- Loading is the process of reading .class file data and store
corresponding binary data in method area.
Cont..
For each class file JVM will store
1. Fully qualified name of the class.
2. Fully qualified name of immediate parent.
3. Weather .class file represents class/interface/enum.
4. Methods / Constructor / Variable information.
5. Modifier information.
6. Constant information
Linking
It consist of three activity .
1.Verification
2.Preparation
3. Resolution
Linking/Verification
● Its is process of ensuring that binary representation of class is structurally
correct or not .
○ i.e weather .class file properly formatted or not
○ Weather .class file generated by valid compiler.
● ByteCode verifier is responsible for these kind of activity .which i part of class
loader subsystem.
● If verification failed program will get RuntimeException : java.lang.VerifyError
Linking/Preparation
In this phase JVM will allocate memory for class level static variables and
assigned with default value.
E.g
1. For int → 0
2. For double → 0.0
3. For boolean → false
Note:Here just default values will be assigned and original value will be assigned
in initialization phase.
Linking/Resolution
When we compile our program we get separate file of .class file for each class ,
but they have some symbolic connection between each other ,And when we run
our program JVM loads the program classes and hooks them together in process
of dynamic linking .
Initialization
In this phase for static variable original value will be initialized and static block
execution will be performed from top to bottom.
Note : while Loading , Linking , Initializing if any problem occur so JVM will give
Runtimeexception re: java.lang.LinkageError
Types of Class Loader
Every class loader subsystem contain three type of class loader.
1. BootStrap class loader
2. Extension class loader
3. Application class loader
Class Loader Working
1. Class loader follow delegation hierarchy principal .
2. Whenever JVM come across a Particular class , First it check weather the
corresponding class already loaded or not .
3. If already loader in method area then JVM will use that loaded class.
4. Other wise subsystem class loader will load the class file.
5. Application class loader delegates request extension class loader and
extension class loader delegates to bootstrap class loader.
6. Bootstrap class loader searches in bootstrap class path (JDK/JRE/LIB). If
class is available then it will be loaded otherwise bootstrap delegate it to the
Extension class loader.
Method Area
● Java Virtual machine method area can be used to store all class code or
method code.
● All classes bytecode is loaded and stored in this runtime area , and all static
variable create in this area .
Runtime Constant Pool
● Runtime constant pool is created out of the method area and it is created by JVM when a class or interface
is created. Runtime constant pool contains the constant_pool table which is applicable for per class or
interface. It contains the literals. JVM will throw OutOfMemoryError when it cannot find memory to allocate
to runtime constant pool.
Heap Memory
● JVM heap area can be used to store all the objects that are created .
● It is the main memory of JVM . all object of classes
● This is finite memory area and it can be configured at the time of setting up
runtime environment using java -Xms <size> and -Xmx<size> class-name.
● This can be expandable its own , depending upon the object creation.
Java Stack Area
● In stack area for every thread a runtime area will be created .
● Suppose we have t1,t2….tn memory area in the stack so for every area is
called stack frame and each stack frame have three parts Local variable
array ,Operand stack , frame data.
● All local runtime variable is stored in the stack.
PC Registers
For every thread there will be sperapare memory area in the pc register suppose
we have pc register for t1 for t2 … fro tn
PC Register in java virtual machine will contain the instruction of next address
that has to be execute.
Native Method stack
It contain all native method used in application .
Execution Engine
The execution engine of JVM is responsible for execution the program and it
contain two parts.
1. Interpreter
2. JIT Compiler
Interpreter : The java compiler translate Java program into java bytecode . Java
interpreter is used to run the compiled java bytecode program.
JIT
JIT compile part of bytecode that have similar functionality , so in that way it
reduces the amount of time needed for compilation .
It is used to improve the performance .

More Related Content

What's hot

What's hot (20)

JVM- Java Virtual Machine
JVM- Java Virtual MachineJVM- Java Virtual Machine
JVM- Java Virtual Machine
 
Java-java virtual machine
Java-java virtual machineJava-java virtual machine
Java-java virtual machine
 
Java Virtual Machine - Internal Architecture
Java Virtual Machine - Internal ArchitectureJava Virtual Machine - Internal Architecture
Java Virtual Machine - Internal Architecture
 
Jvm
JvmJvm
Jvm
 
Advanced java-training-in-bangalore
Advanced java-training-in-bangaloreAdvanced java-training-in-bangalore
Advanced java-training-in-bangalore
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
Introduction of jvm|Java Training In Jaipur | Java Training Jaipur | Java Tra...
 
QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)QSpiders - Memory (JVM architecture)
QSpiders - Memory (JVM architecture)
 
Java Virtual Machine
Java Virtual Machine Java Virtual Machine
Java Virtual Machine
 
Java byte code presentation
Java byte code presentationJava byte code presentation
Java byte code presentation
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
What's Inside a JVM?
What's Inside a JVM?What's Inside a JVM?
What's Inside a JVM?
 
What is-java
What is-javaWhat is-java
What is-java
 
JAVA BYTE CODE
JAVA BYTE CODEJAVA BYTE CODE
JAVA BYTE CODE
 
Jvm architecture
Jvm architectureJvm architecture
Jvm architecture
 
Basic difference between jdk,jre,jvm in advance java course
Basic difference between jdk,jre,jvm in advance java courseBasic difference between jdk,jre,jvm in advance java course
Basic difference between jdk,jre,jvm in advance java course
 
The Real Thing: Java Virtual Machine
The Real Thing: Java Virtual MachineThe Real Thing: Java Virtual Machine
The Real Thing: Java Virtual Machine
 
Inside the jvm
Inside the jvmInside the jvm
Inside the jvm
 
JVM
JVMJVM
JVM
 
Android Training Chandigarh
Android Training ChandigarhAndroid Training Chandigarh
Android Training Chandigarh
 

Similar to Jvm internal detail

A Brief study on JVM A Brief study on JVM
A Brief study on JVM A Brief study on JVMA Brief study on JVM A Brief study on JVM
A Brief study on JVM A Brief study on JVMBRNSSPublicationHubI
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDEShweta Oza
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machineLaxman Puri
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfGeekster
 
Lecture 2 Java Virtual Machine .pptx
Lecture 2 Java Virtual Machine .pptxLecture 2 Java Virtual Machine .pptx
Lecture 2 Java Virtual Machine .pptxAnupamKumar559254
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting StartedRakesh Madugula
 
Advanced java training in bangalore
Advanced java training in bangaloreAdvanced java training in bangalore
Advanced java training in bangaloresiyaram ray
 
Ijaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderIjaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderijaprr_editor
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionGanesh Samarthyam
 
Javanotes ww8
Javanotes ww8Javanotes ww8
Javanotes ww8kumar467
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 

Similar to Jvm internal detail (20)

Basic Java I
Basic Java IBasic Java I
Basic Java I
 
Java JDK.docx
Java JDK.docxJava JDK.docx
Java JDK.docx
 
A Brief study on JVM A Brief study on JVM
A Brief study on JVM A Brief study on JVMA Brief study on JVM A Brief study on JVM
A Brief study on JVM A Brief study on JVM
 
How to run java program without IDE
How to run java program without IDEHow to run java program without IDE
How to run java program without IDE
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
 
JVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdfJVM Architecture – How It Works.pdf
JVM Architecture – How It Works.pdf
 
Lecture 2 Java Virtual Machine .pptx
Lecture 2 Java Virtual Machine .pptxLecture 2 Java Virtual Machine .pptx
Lecture 2 Java Virtual Machine .pptx
 
A begineers guide of JAVA - Getting Started
 A begineers guide of JAVA - Getting Started A begineers guide of JAVA - Getting Started
A begineers guide of JAVA - Getting Started
 
Java lab lecture 1
Java  lab  lecture 1Java  lab  lecture 1
Java lab lecture 1
 
Advanced java training in bangalore
Advanced java training in bangaloreAdvanced java training in bangalore
Advanced java training in bangalore
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
JAVA for Every one
JAVA for Every oneJAVA for Every one
JAVA for Every one
 
JAVA Program Examples
JAVA Program ExamplesJAVA Program Examples
JAVA Program Examples
 
Java lab zero lecture
Java  lab  zero lectureJava  lab  zero lecture
Java lab zero lecture
 
Ijaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinderIjaprr vol1-2-13-60-64tejinder
Ijaprr vol1-2-13-60-64tejinder
 
Jvm
JvmJvm
Jvm
 
College Project - Java Disassembler - Description
College Project - Java Disassembler - DescriptionCollege Project - Java Disassembler - Description
College Project - Java Disassembler - Description
 
Java notes
Java notesJava notes
Java notes
 
Javanotes ww8
Javanotes ww8Javanotes ww8
Javanotes ww8
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 

More from Mohammad Faizan

More from Mohammad Faizan (18)

Colloquium Report
Colloquium ReportColloquium Report
Colloquium Report
 
Jdbc basic features
Jdbc basic featuresJdbc basic features
Jdbc basic features
 
Tutorial c#
Tutorial c#Tutorial c#
Tutorial c#
 
Java 8 from perm gen to metaspace
Java 8  from perm gen to metaspaceJava 8  from perm gen to metaspace
Java 8 from perm gen to metaspace
 
SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4  SOFTWARE TESTING UNIT-4
SOFTWARE TESTING UNIT-4
 
Software maintenance Unit5
Software maintenance  Unit5Software maintenance  Unit5
Software maintenance Unit5
 
Hibernate using jpa
Hibernate using jpaHibernate using jpa
Hibernate using jpa
 
Unit3 Software engineering UPTU
Unit3 Software engineering UPTUUnit3 Software engineering UPTU
Unit3 Software engineering UPTU
 
Unit2 Software engineering UPTU
Unit2 Software engineering UPTUUnit2 Software engineering UPTU
Unit2 Software engineering UPTU
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Allama Iqbal shiqwa with meaning
Allama Iqbal shiqwa with meaningAllama Iqbal shiqwa with meaning
Allama Iqbal shiqwa with meaning
 
Web tech chapter 1 (1)
Web tech chapter 1 (1)Web tech chapter 1 (1)
Web tech chapter 1 (1)
 
Mdm intro-chapter1
Mdm intro-chapter1Mdm intro-chapter1
Mdm intro-chapter1
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Coda file system tahir
Coda file system   tahirCoda file system   tahir
Coda file system tahir
 
Chapter30 (1)
Chapter30 (1)Chapter30 (1)
Chapter30 (1)
 
Ai4 heuristic2
Ai4 heuristic2Ai4 heuristic2
Ai4 heuristic2
 
Chapter30
Chapter30Chapter30
Chapter30
 

Recently uploaded

Career-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxCareer-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxGachaFluffy
 
Network to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchNetwork to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchBruce Bennett
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathanBaughman3
 
Complete Benefits of career counseling in India
Complete Benefits of career counseling in IndiaComplete Benefits of career counseling in India
Complete Benefits of career counseling in IndiaMere Mentor
 
Jumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3AJumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3Ajumarkdiezmo1
 
Thomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialThomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialsafdarhussainbhutta4
 
Chapter 4 - Promoting Inclusive Culture.ppt
Chapter 4 - Promoting   Inclusive Culture.pptChapter 4 - Promoting   Inclusive Culture.ppt
Chapter 4 - Promoting Inclusive Culture.pptmoytopo
 
Training for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptTraining for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptVidalMendoza5
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewNilendra Kumar
 
How to prepare yourself for a job interview.pptx
How to prepare yourself for a job interview.pptxHow to prepare yourself for a job interview.pptx
How to prepare yourself for a job interview.pptxJohnreyFalsarioBasid
 
美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作ss846v0c
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoubGhobrial1
 
Design, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxDesign, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxaaronbasko1
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveMarharyta Nedzelska
 
What is the career path of a VFX artist?
What is the career path of a VFX artist?What is the career path of a VFX artist?
What is the career path of a VFX artist?santoshjadhav126
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Pressmatingpress170
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoubGhobrial1
 
Transportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxTransportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxSheldon Byron
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024Bruce Bennett
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024Bruce Bennett
 

Recently uploaded (20)

Career-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxCareer-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptx
 
Network to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job SearchNetwork to Success - Using Social Media in Job Search
Network to Success - Using Social Media in Job Search
 
Nathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editorNathan_Baughman_Resume_copywriter_and_editor
Nathan_Baughman_Resume_copywriter_and_editor
 
Complete Benefits of career counseling in India
Complete Benefits of career counseling in IndiaComplete Benefits of career counseling in India
Complete Benefits of career counseling in India
 
Jumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3AJumark Morit Diezmo- Career portfolio- BPED 3A
Jumark Morit Diezmo- Career portfolio- BPED 3A
 
Thomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialThomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping material
 
Chapter 4 - Promoting Inclusive Culture.ppt
Chapter 4 - Promoting   Inclusive Culture.pptChapter 4 - Promoting   Inclusive Culture.ppt
Chapter 4 - Promoting Inclusive Culture.ppt
 
Training for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptTraining for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.ppt
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
 
How to prepare yourself for a job interview.pptx
How to prepare yourself for a job interview.pptxHow to prepare yourself for a job interview.pptx
How to prepare yourself for a job interview.pptx
 
美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作美国SU学位证,雪城大学毕业证书1:1制作
美国SU学位证,雪城大学毕业证书1:1制作
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdf
 
Design, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxDesign, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptx
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental Leave
 
What is the career path of a VFX artist?
What is the career path of a VFX artist?What is the career path of a VFX artist?
What is the career path of a VFX artist?
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Press
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdf
 
Transportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptxTransportation and Trade Part 5 (1) (1).pptx
Transportation and Trade Part 5 (1) (1).pptx
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024
 
LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024LinkedIn for Your Job Search in April 2024
LinkedIn for Your Job Search in April 2024
 

Jvm internal detail

  • 2. Virtual Machine Virtual Machine : A simple software simulation of physical machine that is act like physical machine but it doesn't have any physical existence. Like : Calculator Software Type of Virtual Machine : 1. Hardware based virtual Machine 2. Application Based or process processed virtual machine
  • 3. Hardware Based Virtual Machine When we create several logical system on the same computer with strong isolation from each other so that is Hardware Based virtual Machine. The main advantage of it is to utilization of our hardware . Examples : Cloud Computing VMWare KVM (Kernel Based Virtual machine )
  • 4. Application Based Virtual Machine These virtual machines acts as runtime engine to run a programming language application. Example JVM : It is a runtime engine to run java application .
  • 5. Java Virtual Machine JVM is runtime engine to run java based application , it's part of JRE . JVM is responsible for two activity to load and run java application . JVM is divided into 3 components 1. Class Loader subsystem (To load .class file) 2. Memory area 3. Execution engine
  • 7. Class Loader Subsystem Class Loader is responsible for three activity . 1. Loading 2. Linking 3. Initializing 1. Loading :- Loading is the process of reading .class file data and store corresponding binary data in method area.
  • 8. Cont.. For each class file JVM will store 1. Fully qualified name of the class. 2. Fully qualified name of immediate parent. 3. Weather .class file represents class/interface/enum. 4. Methods / Constructor / Variable information. 5. Modifier information. 6. Constant information
  • 9.
  • 10. Linking It consist of three activity . 1.Verification 2.Preparation 3. Resolution
  • 11. Linking/Verification ● Its is process of ensuring that binary representation of class is structurally correct or not . ○ i.e weather .class file properly formatted or not ○ Weather .class file generated by valid compiler. ● ByteCode verifier is responsible for these kind of activity .which i part of class loader subsystem. ● If verification failed program will get RuntimeException : java.lang.VerifyError
  • 12. Linking/Preparation In this phase JVM will allocate memory for class level static variables and assigned with default value. E.g 1. For int → 0 2. For double → 0.0 3. For boolean → false Note:Here just default values will be assigned and original value will be assigned in initialization phase.
  • 13. Linking/Resolution When we compile our program we get separate file of .class file for each class , but they have some symbolic connection between each other ,And when we run our program JVM loads the program classes and hooks them together in process of dynamic linking .
  • 14. Initialization In this phase for static variable original value will be initialized and static block execution will be performed from top to bottom. Note : while Loading , Linking , Initializing if any problem occur so JVM will give Runtimeexception re: java.lang.LinkageError
  • 15. Types of Class Loader Every class loader subsystem contain three type of class loader. 1. BootStrap class loader 2. Extension class loader 3. Application class loader
  • 16.
  • 17.
  • 18. Class Loader Working 1. Class loader follow delegation hierarchy principal . 2. Whenever JVM come across a Particular class , First it check weather the corresponding class already loaded or not . 3. If already loader in method area then JVM will use that loaded class. 4. Other wise subsystem class loader will load the class file. 5. Application class loader delegates request extension class loader and extension class loader delegates to bootstrap class loader. 6. Bootstrap class loader searches in bootstrap class path (JDK/JRE/LIB). If class is available then it will be loaded otherwise bootstrap delegate it to the Extension class loader.
  • 19.
  • 20. Method Area ● Java Virtual machine method area can be used to store all class code or method code. ● All classes bytecode is loaded and stored in this runtime area , and all static variable create in this area . Runtime Constant Pool ● Runtime constant pool is created out of the method area and it is created by JVM when a class or interface is created. Runtime constant pool contains the constant_pool table which is applicable for per class or interface. It contains the literals. JVM will throw OutOfMemoryError when it cannot find memory to allocate to runtime constant pool.
  • 21. Heap Memory ● JVM heap area can be used to store all the objects that are created . ● It is the main memory of JVM . all object of classes ● This is finite memory area and it can be configured at the time of setting up runtime environment using java -Xms <size> and -Xmx<size> class-name. ● This can be expandable its own , depending upon the object creation.
  • 22. Java Stack Area ● In stack area for every thread a runtime area will be created . ● Suppose we have t1,t2….tn memory area in the stack so for every area is called stack frame and each stack frame have three parts Local variable array ,Operand stack , frame data. ● All local runtime variable is stored in the stack.
  • 23. PC Registers For every thread there will be sperapare memory area in the pc register suppose we have pc register for t1 for t2 … fro tn PC Register in java virtual machine will contain the instruction of next address that has to be execute. Native Method stack It contain all native method used in application .
  • 24. Execution Engine The execution engine of JVM is responsible for execution the program and it contain two parts. 1. Interpreter 2. JIT Compiler Interpreter : The java compiler translate Java program into java bytecode . Java interpreter is used to run the compiled java bytecode program.
  • 25. JIT JIT compile part of bytecode that have similar functionality , so in that way it reduces the amount of time needed for compilation . It is used to improve the performance .