Friday, 15 March 2013

What is JVM?

What is JVM? 
JVM (Java Virtual Machine) is a platform - independent execution environment that converts Java bytecode into machine language and executes it.
JVM - Java Virtual Machine.

JVM consist of following components:-

1) Byte-code
 verifier: - It verify the byte-code ,it check's for unusual code.

2) Class Loader: - After verifying Class Loader will load the byte-code into the memory for execution.

3) Execution engine: -
It further consists of
 2 parts :-
a) Interpreter: - It interprets
 the code & run.
b) JIT (Just-in-Time Interpreter)
JVM Hotspot defines when to use Interpreter or JIT.

4) Garbage Collector: - It periodically check for the object on heap , whose link is broken
So it can collect the garbage from Heap.

5) Security Manager: - It constantly monitors
 the code. It is 2nd level of security.[1st level is Byte-code verifier ].
JVM stands for Java Virtual Machine. As the name indicates, it does not a real hardware machine but a software layer which resembles a hardware platform. JVM helps to run java programs on different Operating system platforms. The JVM will be different for different Operating Systems i.e. there will be separate JVM for Windows and Linux. Now I am going to explain how Java achieves platform independents with the help of JVM. We can write the java program on any platform. The source program is then converted to byte code using a Java compiler. The compiler will be different for different platforms. The byte code can be executed on any platform where there exist JVM.

Blog Author: Vijay Kumar

Go to: Coding Problem Solutions

No comments: