Hello friends
I am Kushal Bhatt
And I am welcome you on my another content on our blog CompuTech.
I am Kushal Bhatt
And I am welcome you on my another content on our blog CompuTech.
In this blog we are discuss on JVM and JRE.
So lets start our today's topic.
So lets start our today's topic.
It's not necessary to know internal works of JVM and it not having connection to java code programming but if you want to make deep knowledge related to java then you can find it here and it can be helpful to solve a problem which is unsolvable.
1. What is JVM.?
JVM stands for Java Virtual Machine.
It is also called a Abstract Computer or Virtual Computer.
JVM us essential part of Java.
Normally all language compiler are translate source code to machine code for a specific computer .
Java compiler is also done those things with slightly different way.
It is also called a Abstract Computer or Virtual Computer.
JVM us essential part of Java.
Normally all language compiler are translate source code to machine code for a specific computer .
Java compiler is also done those things with slightly different way.
You are already know the java is both compiler and interpreter language.
So once java compiler convert your source code to not machine code but it convert into byte code.
This byte code are not understandable by computer as well as human.
In practical way, when you compile your *.java file in cmd compiler create a *.class file which is a byte code file as the place where .java file exist.
This byte code are not understandable by computer as well as human.
In practical way, when you compile your *.java file in cmd compiler create a *.class file which is a byte code file as the place where .java file exist.
This byte code file hand over to java JVM for further processing.
Now actual JVM work is begin,
Now this byte code are not understandable to computer so we need to make it convert into machine code which is understandable by computer and run it.
Now this byte code are not understandable to computer so we need to make it convert into machine code which is understandable by computer and run it.
JVM has many responsibility to do like to check user are use which operating system and hardware config. And JVM is convert that byte code to machine code according to user OS and hardware for fulfill Platform Independent.
This machine code actually generated by java interpreter which is exist in JVM this java Interpreter is different for different OS.
JVM is exist only inside the computer memory and does all major function of real computer.
Java provide a virtual memory to code and handle byte code to make more efficiently fulfill machine dependent approach.
Once compiler compile *.java file then it generate byte code file means *.class file is run on any machine or any OS .
So we can say that JVM is provide a interface between OS and Hardware for processing output.
This machine code actually generated by java interpreter which is exist in JVM this java Interpreter is different for different OS.
JVM is exist only inside the computer memory and does all major function of real computer.
Java provide a virtual memory to code and handle byte code to make more efficiently fulfill machine dependent approach.
Once compiler compile *.java file then it generate byte code file means *.class file is run on any machine or any OS .
So we can say that JVM is provide a interface between OS and Hardware for processing output.
Now we are understand Internal Work of JVM...
When compiler handover byte code to JVM .
JVM has to perform many function concurrently like,
JVM has to perform many function concurrently like,
Class Loader.
Memory Management .
Execution Engine.
Memory Management .
Execution Engine.
1.Class Loader.
Class Loader used to load Byte code to data areas for execution.
First of all it need to linking with correct file to load classes of generated byte code .
First of all it need to linking with correct file to load classes of generated byte code .
When class Loader receive a request of loading class then it need to check or verify to Cache for see class is loaded or not.
If not then it give to Bootstrap class Loader which is parent class and work is to load all core libraries for machine code generating.
If not then it give to Bootstrap class Loader which is parent class and work is to load all core libraries for machine code generating.
If If parent class is not suppose to able to load class then it requesting to child class Loader is Extension class Loader. It is used to load extension classes libraries.
Extension class loader is child of Bootstrap class loader.
Extension class loader is child of Bootstrap class loader.
If this child class is not able to load all class then it request to System Class Loader which is child of Extension class loader. And it is used to load all Application classes libraries.
If this also not able to load all class then it requesting last child class of System class Loader is User Defined Class Loader.it is used to load all user defined classes for machine code generation process.
Now after successfully loaded all classes we need to intialize and execute all command of Byte code.
2. Memory Management.
There are many things are to help a managing memory .
Method area is used to store a class code which is method code and used to create static variables.
Heap Area.
It is used to store a object of a classes contain in byte code to be execute.
It is also main memory of JVM .
This memory area is very flexible.
It can expandable depend on object size.
It is used to store a object of a classes contain in byte code to be execute.
It is also main memory of JVM .
This memory area is very flexible.
It can expandable depend on object size.
Heap and Method both have shared Memory .
PC Register is used to store a address of next instruction to be execute for generating machine code.
Native Method area store a all non java classes and methods.
Garbage Collector is most import thing in memory management .
It is used to automatic clear up memory when ever requiring .
It is invoke automatically when it decide to release memory area.
It is used to automatic clear up memory when ever requiring .
It is invoke automatically when it decide to release memory area.
3. Execution Engine.
Execution Engine execute a program in two part.
->Interpretion
->JIT(Just In Time)compiler.
Interpretion is used to execute and change each and every command from byte code to machine code.
JIT Compiler is used to execute that command and convert into .machine code.
Both JIT and Interpretion are work concurrently which is reduce execution time and provide High Performance .
Both JIT and Interpretion are work concurrently which is reduce execution time and provide High Performance .
JNI it is Java Native Libraries is used to provide a Native Methods And Classes Libraries like C and C++ codes to use in java because java can support Native Methods.
JVM is also handle the threads to perform on time or not in correct way.
This blog is all about a information of internal use of JVM please share and comment for suggestion.
See you to next time.
For more useful article
Reason of invention of java real time use of java click here.
Feature of java.
https://computech18.blogspot.in/2017/11/features-of-java-for-beginners.html
See you to next time.
For more useful article
Reason of invention of java real time use of java click here.
Feature of java.
https://computech18.blogspot.in/2017/11/features-of-java-for-beginners.html
Comments
Post a Comment