JVM is an engine that offers the Java Code or applications runtime environment. It transforms bytecode Java into the language of computers. JVM (Java Run Environment) is a component of JRE. It is a Java Virtual Machine.
JVM is an abstract machine (Java Virtual Machine). It is a specification that offers runtime environment and allows the execution of java bytecode.
For many hardware and software platforms, JVMs are available (i.e. JVM depends on the platform).
JVM is the Java Virtual Machine – it actually executes Java ByteCode.
JRE is the Java Runtime Environment – it contains a JVM, among other things, and is what you need to run a Java program.
JDK is the Java Development Kit – it is the JRE, but with javac (which is what you need to compile Java source code) and has other programming tools added.
Let's comprehend JVM's inner architecture. It includes classloader, region of memory, engine of execution, etc.
Classloader is a JVM subsystem for loading class files. Every time we run the java program, the classloader loads it first. In Java, there are three integrated class loaders.
// Below is an example to print the classloadername in java publicclass MyClassLoaderProgram { publicstaticvoid main(String[] args) { Class c= MyClassLoaderProgram.class; System.out.println(c.getClassLoader()); System.out.println(String.class.getClassLoader()); } }
These are Java's inner class loaders. You need to extend the ClassLoader class if you want to create your own classloader.
Class(Method) Area stores structures per class such as the runtime constant pool, field and method data, the method code.
It is the runtime data pool in which objects are placed.
Frames are stored in Java Stack. It maintains local variables and partial outcomes and plays a role in invoking and returning the method.
Each thread has a personal JVM stack, which is generated simultaneously with a thread.
Every time a method is invoked, a new frame is developed. When the invocation method finishes, a frame is demolished.
PC (program counter) register includes the address of the presently executed Java virtual machine instruction.
It includes all of the application's native methods.
It contains the below things:
Java Native Interface (JNI) is a framework for communicating with another application written in a different language such as C, C++, Assembly, etc. Java utilizes JNI framework to send output or communicate with OS libraries to the Console.
Keep sharing blogs like this one; they are quite good. You have given everyone in this blog access to a wealth of information.
Thank you for your valuable information.
Thank you for this wonderful article!
This article was really helpful to me, thank you!
super article!
Leave a Reply
Your email address will not be published. Required fields are marked *