04.JVM Detailes
04.JVM Detailes
Vishnu
What is JVM?
JVM is a virtual machine or a program that provides run-time environment in which java
byte code can be executed. JVMs are available for many hardware and software
platforms. The use of the same byte code for all JVMs on all platforms make java
platform independent.
JVM diagram:
1
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar Signal,
S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.
04. JVM By Mr. Vishnu
JVM details:
2. Class/method area:
It is a part of JVM that contains the information of types/classes loaded by class loader.
It also contain the static variable, method body etc.
3. Heap:
It is a part of JVM that contains object. When a new object is created, memory is
allocated to the object from the heap and object is no longer referenced memory is
reclaimed by garbage collector.
4. Java Stack:
It is a part of JVM that contains local variable, operands and frames. To perform an
operation, Byte code instructions takes operands from the stack, operate and then
return the result in to the java stack.
5. Program Counter:
For each thread JVM instance provide a separate program counter (PC) or pc register
which contains the address of currently executed instruction.
As java program can call native methods (A method written in other language like c).
Native method stack contains these native methods.
7. Execution Engine:
It is a part JVM that uses Virtual processor (for execution), interpreter (for reading
instructions) and JIT (Just in time) compiler (for performance improvement) to execute
the instructions.
When JRE installed on your machine, you got all required code to create JVM. JVM is
created when you run a java program, e.g. If you create a java program named
2
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar Signal,
S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.
04. JVM By Mr. Vishnu
Lifetime of JVM:
3
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar Signal,
S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.
04. JVM By Mr. Vishnu
4
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar Signal,
S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.
04. JVM By Mr. Vishnu
5
Sri Sureka Technologies, NearAndraBank,Opposite Geethanjali High School, Near S.R.Nagar Signal,
S.R.Nagar, Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.