What is JVM??

Source: https://www.guru99.com/java-virtual-machine-jvm.html

JVM stands for Java Virtual Machine. As it mentioned in the name, it was a type of a virtual machine. The term virtual means it is not exist physically, but it simulate the real environment. When install the JRE(Java Runtime Environment) for the particular Operating System, it deploy the all the necessary code that needs to create a program called JVM. As we cannot install the JVM physically to the machine, it works as a virtual machine.

Virtual Machine has major two types.

  1. System based Virtual Machine (SVM)
  2. Application based Virtual Machine (AVM)

In system based virtual machine, it use one/same hardware for creating different multiple environment. Hypervisor and Xen are the example for that. Hypervisor use computer memory, hard disk, CPU, network and other hardware resources to create multiple VM according to their particular requirements and specification. It creates a same physical host system to deploy different types of OS such as Linux, Windows.

Application based virtual machine not like SVM, it is a kind of software application that creates platforms to run another software. No hardware involvement in there. JVM, PVM and CLR are some example for that. Now you can understand that the JVM is kind of AVM that enable to run java programs.

So, what are the main functions of the JVM???

The answer is, JVM is a specification that explains how the things to be done in according to run a java program. When we write a java program and execute it, at that moment JVM creates JVM instance and that JVM instance is responsible for converting the bytecode into machine code.

The next question is, Is the JVM instance always in your computer???

The answer is no. If you are not execute or run any java program in your machine, at that particular time frame there is no any JVM instance in your computer. It means JVM instance only available if and only if we are executing a java program.

Last question is, What are the ways that JVM can get destroyed???

Actually there are two ways that the JVM can be destroyed. They are,

  1. If there is no any non-demand thread exist on the machine, then the JVM instance is destroyed. It means all the created non-demand thread were finished their execution already. So there is no point in available JVM instance.
  2. Next way is a java program can stop the execution of the program calling exit(); method by itself. After the executing exit() method there is no any java program available and JVM instance is destroyed at that time.

Hope, you will get some basic information about the JVM and I’ll discuss about the structure of the JVM in next article…..

Stay Safe & learning new things!!!!




Currently working as an Associate Software Engineer at Virtusa. Has completed degree in B.Sc (Hons) Computing & Information Systems. After all I am a Human...

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

4 Easy Hacks To Make Yourself a More Valuable Developer

Image of brain meshed with face

Scalable & Highly Available Web & Mobile App Architecture

Binary, An Explainer

A day in the life of a scrum master in a Startup

Use of Documentation in Complex Agile Environments

What would an optimal monorepo look like? [experiment]

I Might Not Have Switched to PySpark, Had I Found This Earlier

Frontend Application Performance Feedback at NerdWallet

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Thilini Weerasinghe

Thilini Weerasinghe

Currently working as an Associate Software Engineer at Virtusa. Has completed degree in B.Sc (Hons) Computing & Information Systems. After all I am a Human...

More from Medium

Creating a java library, a place where any problem can be resolved.

Head First Java Chapter 3 Summery

Sorting Techniques and When to use them ?

Admiring Spring