SlideShare ist ein Scribd-Unternehmen logo
1 von 3
Downloaden Sie, um offline zu lesen
What is JVM
It is:
1. A specification where working of Java Virtual Machine is specified. But
implementation provider is independent to choose the algorithm. Its
implementation has been provided by Oracle and other companies.
2. An implementation Its implementation is known as JRE (Java Runtime
Environment).
3. Runtime Instance Whenever you write java command on the
command prompt to run the java class, an instance of JVM is created.
What it does
The JVM performs following operation:
o Loads code
o Verifies code
o Executes code
o Provides runtime environment
JVM provides definitions for the:
o Memory area
o Class file format
o Register set
o Garbage-collected heap
o Fatal error reporting etc.
JVM Architecture
Let's understand the internal architecture of JVM. It contains classloader,
memory area, execution engine etc.
1) Classloader
Classloader is a subsystem of JVM which is used to load class files. Whenever
we run the java program, it is loaded first by the classloader. There are three
built-in classloaders in Java.
1. Bootstrap ClassLoader: This is the first classloader which is the super
class of Extension classloader. It loads the rt.jar file which contains all
class files of Java Standard Edition like java.lang package classes,
java.net package classes, java.util package classes, java.io package
classes, java.sql package classes etc.
2. Extension ClassLoader: This is the child classloader of Bootstrap and
parent classloader of System classloader. It loades the jar files located
inside $JAVA_HOME/jre/lib/ext directory.
3. System/Application ClassLoader: This is the child classloader of
Extension classloader. It loads the classfiles from classpath. By
default,classpath is set to current directory. You can change the classpath
using
"-cp" or "-classpath" switch. It is also known as Application classloader.
2) Class(Method) Area
Class(Method) Area stores per-class structures such as the runtime constant
pool, field and method data, the code for methods.
3) Heap
It is the runtime data area in which objects are allocated
.
4) Stack
Java Stack stores frames. It holds local variables and partial results, and plays a
part in method invocation and return.
Each thread has a private JVM stack, created at the same time as thread.
A new frame is created each time a method is invoked. A frame is destroyed
when its method invocation completes.
5) Program Counter Register
PC (program counter) register contains the address of the Java virtual machine
instruction currently being executed.
6) Native Method Stack
It contains all the native methods used in the application.
7) Execution Engine
It contains:
1. A virtual processor
2. Interpreter: Read bytecode stream then execute the instructions.
3. Just-In-Time(JIT) compiler: It is used to improve the performance. JIT
compiles parts of the byte code that have similar functionality at thesame time,
and hence reduces the amount of time needed for
compilation. Here, the term "compiler" refers to a translator from the
instruction set of a Java virtual machine (JVM) to the instruction set of a
specific CPU.
Types of Variables
There are three types of variables in Java:
o local variable
o instance variable
o static variable
1) Local Variable
A variable declared inside the body of the method is called local variable. You
can use this variable only within that method and the other methods in the
class aren't even aware that the variable exists.
A local variable cannot be defined with "static" keyword.
2) Instance Variable
A variable declared inside the class but outside the body of the method, is
called an instance variable. It is not declared as static.
It is called an instance variable because its value is instance-specific and is not
shared among instances.
3) Static variable
A variable that is declared as static is called a static variable. It cannot be local.
You can create a single copy of the static variable and share it among all the
instances of the class. Memory allocation for static variables happens only
once when the class is loaded in the memory.

Weitere ähnliche Inhalte

Ähnlich wie WHAT IS JVM.pdf

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
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machineLaxman Puri
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdfvenud11
 
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
 
Java programing considering performance
Java programing considering performanceJava programing considering performance
Java programing considering performanceRoger Xia
 
Unit8 security (2) java
Unit8 security (2) javaUnit8 security (2) java
Unit8 security (2) javaSharafat Husen
 
Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction AKR Education
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMshamnasain
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machineNikhil Sharma
 
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...Rhythm Suiwal
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questionsGradeup
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedGaurav Maheshwari
 

Ähnlich wie WHAT IS JVM.pdf (20)

Java JDK.docx
Java JDK.docxJava JDK.docx
Java JDK.docx
 
Jvm
JvmJvm
Jvm
 
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
 
Java byte code & virtual machine
Java byte code & virtual machineJava byte code & virtual machine
Java byte code & virtual machine
 
1669617800196.pdf
1669617800196.pdf1669617800196.pdf
1669617800196.pdf
 
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 programing considering performance
Java programing considering performanceJava programing considering performance
Java programing considering performance
 
Unit8 security (2) java
Unit8 security (2) javaUnit8 security (2) java
Unit8 security (2) java
 
Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction Unit 1 of java part 2 basic introduction
Unit 1 of java part 2 basic introduction
 
02 basic java programming and operators
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operators
 
Java tips
Java tipsJava tips
Java tips
 
Class loaders
Class loadersClass loaders
Class loaders
 
Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
java basic .pdf
java basic .pdfjava basic .pdf
java basic .pdf
 
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVMJava Virtual Machine (JVM), Difference JDK, JRE & JVM
Java Virtual Machine (JVM), Difference JDK, JRE & JVM
 
Introduction java programming
Introduction java programmingIntroduction java programming
Introduction java programming
 
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...
 
20 most important java programming interview questions
20 most important java programming interview questions20 most important java programming interview questions
20 most important java programming interview questions
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experienced
 

Mehr von Satishkumar722293

Mehr von Satishkumar722293 (20)

What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
CAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdfCAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdf
 
What Is Business Plan.pdf
What Is Business Plan.pdfWhat Is Business Plan.pdf
What Is Business Plan.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
Contingent Staffing.pdf
Contingent Staffing.pdfContingent Staffing.pdf
Contingent Staffing.pdf
 
Digital Marketing.pdf
Digital Marketing.pdfDigital Marketing.pdf
Digital Marketing.pdf
 
Employment Relationship.pdf
Employment Relationship.pdfEmployment Relationship.pdf
Employment Relationship.pdf
 
programming testing.pdf
programming testing.pdfprogramming testing.pdf
programming testing.pdf
 
TRAINING & PLACEMENT CELL.pdf
TRAINING & PLACEMENT CELL.pdfTRAINING & PLACEMENT CELL.pdf
TRAINING & PLACEMENT CELL.pdf
 
Training & Development.pdf
Training & Development.pdfTraining & Development.pdf
Training & Development.pdf
 
What is artificial intelligence.pdf
What is artificial intelligence.pdfWhat is artificial intelligence.pdf
What is artificial intelligence.pdf
 
HUMAN RESOURCE MANAGEMENT.pdf
HUMAN RESOURCE MANAGEMENT.pdfHUMAN RESOURCE MANAGEMENT.pdf
HUMAN RESOURCE MANAGEMENT.pdf
 
CAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdfCAREER DEVELOPMENT.pdf
CAREER DEVELOPMENT.pdf
 
programming testing.pdf
programming testing.pdfprogramming testing.pdf
programming testing.pdf
 
DATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdfDATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdf
 
DATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdfDATA WAREHOUSE CONCEPT.pdf
DATA WAREHOUSE CONCEPT.pdf
 
MANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdfMANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdf
 
WHAT IS HTML.pdf
WHAT IS HTML.pdfWHAT IS HTML.pdf
WHAT IS HTML.pdf
 
MANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdfMANAGEMENT SYSTEM.pdf
MANAGEMENT SYSTEM.pdf
 

Kürzlich hochgeladen

John Steven McRae Resume Generated April 2024
John Steven McRae Resume Generated April 2024John Steven McRae Resume Generated April 2024
John Steven McRae Resume Generated April 2024jsmcrae2016
 
Senior IT Professional with Master’s Degree with 21+ years of experience is...
Senior IT Professional with Master’s Degree with 21+ years of experience   is...Senior IT Professional with Master’s Degree with 21+ years of experience   is...
Senior IT Professional with Master’s Degree with 21+ years of experience is...Anas Acharath Parakat
 
Bobby singh - Digital Marketing Service
Bobby singh -  Digital Marketing ServiceBobby singh -  Digital Marketing Service
Bobby singh - Digital Marketing ServiceBobby singh
 
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
 
About Kelly Wang: Generative AI, SEO, PR
About Kelly Wang: Generative AI, SEO, PRAbout Kelly Wang: Generative AI, SEO, PR
About Kelly Wang: Generative AI, SEO, PRKelly Wang
 
FACILITATING LEARNER-CENTERED TEACHING pptx
FACILITATING LEARNER-CENTERED TEACHING pptxFACILITATING LEARNER-CENTERED TEACHING pptx
FACILITATING LEARNER-CENTERED TEACHING pptxJAMESPARAQUINAN
 
APSC Motor Vechile Inspector 18 Posts.pdf
APSC Motor Vechile Inspector 18 Posts.pdfAPSC Motor Vechile Inspector 18 Posts.pdf
APSC Motor Vechile Inspector 18 Posts.pdfsoumita869
 
Banged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls DubaiBanged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls Dubaikojalkojal131
 
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024Hector Del Castillo, CPM, CPMM
 
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
 
How to make career in advance 3d animation
How to make career in advance 3d animationHow to make career in advance 3d animation
How to make career in advance 3d animationsantoshjadhav126
 
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
 
Training for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptTraining for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptVidalMendoza5
 
Youth Career and Employment Insights and informative Charts
Youth Career and Employment Insights and informative ChartsYouth Career and Employment Insights and informative Charts
Youth Career and Employment Insights and informative ChartsYouthLab
 
Get to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfGet to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfRaquel Thompson Barbados
 
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
 
Design, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxDesign, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxaaronbasko1
 
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEO
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEOKelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEO
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEOKelly Wang
 
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
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoubGhobrial1
 

Kürzlich hochgeladen (20)

John Steven McRae Resume Generated April 2024
John Steven McRae Resume Generated April 2024John Steven McRae Resume Generated April 2024
John Steven McRae Resume Generated April 2024
 
Senior IT Professional with Master’s Degree with 21+ years of experience is...
Senior IT Professional with Master’s Degree with 21+ years of experience   is...Senior IT Professional with Master’s Degree with 21+ years of experience   is...
Senior IT Professional with Master’s Degree with 21+ years of experience is...
 
Bobby singh - Digital Marketing Service
Bobby singh -  Digital Marketing ServiceBobby singh -  Digital Marketing Service
Bobby singh - Digital Marketing Service
 
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?
 
About Kelly Wang: Generative AI, SEO, PR
About Kelly Wang: Generative AI, SEO, PRAbout Kelly Wang: Generative AI, SEO, PR
About Kelly Wang: Generative AI, SEO, PR
 
FACILITATING LEARNER-CENTERED TEACHING pptx
FACILITATING LEARNER-CENTERED TEACHING pptxFACILITATING LEARNER-CENTERED TEACHING pptx
FACILITATING LEARNER-CENTERED TEACHING pptx
 
APSC Motor Vechile Inspector 18 Posts.pdf
APSC Motor Vechile Inspector 18 Posts.pdfAPSC Motor Vechile Inspector 18 Posts.pdf
APSC Motor Vechile Inspector 18 Posts.pdf
 
Banged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls DubaiBanged Dubai Call Girls O525547819 Call Girls Dubai
Banged Dubai Call Girls O525547819 Call Girls Dubai
 
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024
How To Land Your Next PM Dream Job - PMISSC Meeting - April 2024
 
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
 
How to make career in advance 3d animation
How to make career in advance 3d animationHow to make career in advance 3d animation
How to make career in advance 3d animation
 
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
 
Training for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.pptTraining for Deaconess, biblical qualifications.ppt
Training for Deaconess, biblical qualifications.ppt
 
Youth Career and Employment Insights and informative Charts
Youth Career and Employment Insights and informative ChartsYouth Career and Employment Insights and informative Charts
Youth Career and Employment Insights and informative Charts
 
Get to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdfGet to know about Raquel Thompson Barbados.pdf
Get to know about Raquel Thompson Barbados.pdf
 
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
 
Design, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptxDesign, Desire and Demand Presentation.pptx
Design, Desire and Demand Presentation.pptx
 
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEO
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEOKelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEO
Kelly Wang 王薇盈_數位轉型、生成式AI、設計思考、客戶體驗優化、敏捷管理、SEO
 
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
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdf
 

WHAT IS JVM.pdf

  • 1. What is JVM It is: 1. A specification where working of Java Virtual Machine is specified. But implementation provider is independent to choose the algorithm. Its implementation has been provided by Oracle and other companies. 2. An implementation Its implementation is known as JRE (Java Runtime Environment). 3. Runtime Instance Whenever you write java command on the command prompt to run the java class, an instance of JVM is created. What it does The JVM performs following operation: o Loads code o Verifies code o Executes code o Provides runtime environment JVM provides definitions for the: o Memory area o Class file format o Register set o Garbage-collected heap o Fatal error reporting etc. JVM Architecture Let's understand the internal architecture of JVM. It contains classloader, memory area, execution engine etc. 1) Classloader Classloader is a subsystem of JVM which is used to load class files. Whenever we run the java program, it is loaded first by the classloader. There are three built-in classloaders in Java.
  • 2. 1. Bootstrap ClassLoader: This is the first classloader which is the super class of Extension classloader. It loads the rt.jar file which contains all class files of Java Standard Edition like java.lang package classes, java.net package classes, java.util package classes, java.io package classes, java.sql package classes etc. 2. Extension ClassLoader: This is the child classloader of Bootstrap and parent classloader of System classloader. It loades the jar files located inside $JAVA_HOME/jre/lib/ext directory. 3. System/Application ClassLoader: This is the child classloader of Extension classloader. It loads the classfiles from classpath. By default,classpath is set to current directory. You can change the classpath using "-cp" or "-classpath" switch. It is also known as Application classloader. 2) Class(Method) Area Class(Method) Area stores per-class structures such as the runtime constant pool, field and method data, the code for methods. 3) Heap It is the runtime data area in which objects are allocated . 4) Stack Java Stack stores frames. It holds local variables and partial results, and plays a part in method invocation and return. Each thread has a private JVM stack, created at the same time as thread. A new frame is created each time a method is invoked. A frame is destroyed when its method invocation completes. 5) Program Counter Register PC (program counter) register contains the address of the Java virtual machine instruction currently being executed.
  • 3. 6) Native Method Stack It contains all the native methods used in the application. 7) Execution Engine It contains: 1. A virtual processor 2. Interpreter: Read bytecode stream then execute the instructions. 3. Just-In-Time(JIT) compiler: It is used to improve the performance. JIT compiles parts of the byte code that have similar functionality at thesame time, and hence reduces the amount of time needed for compilation. Here, the term "compiler" refers to a translator from the instruction set of a Java virtual machine (JVM) to the instruction set of a specific CPU. Types of Variables There are three types of variables in Java: o local variable o instance variable o static variable 1) Local Variable A variable declared inside the body of the method is called local variable. You can use this variable only within that method and the other methods in the class aren't even aware that the variable exists. A local variable cannot be defined with "static" keyword. 2) Instance Variable A variable declared inside the class but outside the body of the method, is called an instance variable. It is not declared as static. It is called an instance variable because its value is instance-specific and is not shared among instances. 3) Static variable A variable that is declared as static is called a static variable. It cannot be local. You can create a single copy of the static variable and share it among all the instances of the class. Memory allocation for static variables happens only once when the class is loaded in the memory.