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
 
Javanotes ww8
Javanotes ww8Javanotes ww8
Javanotes ww8
 
Java notes
Java notesJava notes
Java notes
 
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

VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjLewisJB
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
Employee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchEmployee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchSoham Mondal
 
Final Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipFinal Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipSoham Mondal
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...shivangimorya083
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girlsshivangimorya083
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...Suhani Kapoor
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)Soham Mondal
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...Suhani Kapoor
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Niya Khan
 
Zeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectZeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectPriyanshuRawat56
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士obuhobo
 
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceanilsa9823
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsNiya Khan
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证obuhobo
 

Recently uploaded (20)

VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service CuttackVIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
VIP Call Girl Cuttack Aashi 8250192130 Independent Escort Service Cuttack
 
Production Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbjProduction Day 1.pptxjvjbvbcbcb bj bvcbj
Production Day 1.pptxjvjbvbcbcb bj bvcbj
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
Employee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchEmployee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India Research
 
Final Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management InternshipFinal Completion Certificate of Marketing Management Internship
Final Completion Certificate of Marketing Management Internship
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
 
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...Vip  Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
Vip Modals Call Girls (Delhi) Rohini 9711199171✔️ Full night Service for one...
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
 
Résumé (2 pager - 12 ft standard syntax)
Résumé (2 pager -  12 ft standard syntax)Résumé (2 pager -  12 ft standard syntax)
Résumé (2 pager - 12 ft standard syntax)
 
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Greater Noida 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
 
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
Neha +91-9537192988-Friendly Ahmedabad Call Girls has Complete Authority for ...
 
Zeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effectZeeman Effect normal and Anomalous zeeman effect
Zeeman Effect normal and Anomalous zeeman effect
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
 
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Saharanpur Aishwarya 8250192130 Independent Escort Ser...
 
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gosainganj Lucknow best sexual service
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
 

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 .