What is this JVM ??
Java Virtual Machine, it’s a common set of words for you if you're following the field of software engineering or development etc. But do you know what it really is?
Okay first of all let's dig into the meaning of these couple of words. You probably know what is java and the grey area is the virtual machine, right?
A Virtual Machine is a mechanism that does the work virtually but is not physically accessible or exists. When every time we run a .java file it creates a JVM and it dies with the program when it ends. A java code must need a running non-daemon thread to exist, if that condition doesn't meet, the java program dies. A JVM is created per a program, if we run 4 .java programs at once there will be 4 JVMs running at that moment. JVM is a complete specification that tells “ how this should be done”. Think about a real-world scenario; driving a car, we have a car and we have all the equipment and requirements to drive the car but we need to know how should we do it, how to start it, how to get it into gear, how to stop it, how to drive under the law …etc. That's exactly what JVM performs for us. JVM interpret the byte code into machine understandable code and tells the machine how this should be done, JVM passes the instruction set to perform the task. JVM is inside the JRE and JVM is deployed according to the specific OS, as an example, if we install the JRE on an apple machine it will install the JVM suitable for the apple machine, but for the windows, it is not the same and a specific JVM designed to windows will be deployed for the windows machines. Even though the JVM is platform-independent, the JRE is tightly platform dependant. The capability of being platform-independent for java come with the JVM.
There are two types of virtual machines present,
- SVM -System Based Virtual Machine
- AVM -Application based virtual machine
SVM
Get Kalana Ravishan Uduwarage’s stories in your inbox
Join Medium for free to get updates from this writer.
This type of VMs creates a totally independent environment to work where multiple instances or users can work on and could have one or more hardware.
Ex:- Xen, Hyper vision
AVM
This type doesn't depend on any hardware but software. These create a platform to run other programs using its own programme or software. JVM falls into this category.
ex:- JVM, YVM, CLR, PVM.
Hope you got an idea about what the JVM is, keep your eyes peeled for another article on JVM architecture.









