.Java Virtual Machine (JVM), Difference JDK, JRE & JVM - Core Java

.Java Virtual Machine (JVM), Difference JDK, JRE & JVM - Core Java

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Class Loader

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (12)

Section 1

(12 cards)

Class Loader

Front

The class loader reads the .class file and save the byte code in the method area.

Back

Stack

Front

Stack is a also a part of JVM memory but unlike Heap, it is used for storing temporary variables.

Back

Native Method stack

Front

A native method can access the run time data areas of the virtual machine

Back

Java is a high level programming language. A program written in high level language cannot be run on any machine directly. First, it needs to be translated into that particular machine language. The javac compiler does this thing, it takes java program (.java file containing source code) and translates it into machine code (referred as byte code or .class file).

Front

Back

PC Registers

Front

This keeps the track of which instruction has been executed and which one is going to be executed. Since instructions are executed by threads, each thread has a separate PC register.

Back

Garbage collection

Front

A class instance is explicitly created by the java code and after use it is automatically destroyed by garbage collection for memory management.

Back

Native Method interface

Front

It enables java code to call or be called by native applications. Native applications are programs that are specific to the hardware and OS of a system.

Back

Method Area

Front

There is only one method area in a JVM which is shared among all the classes. This holds the class level information of each .class file.

Back

As we discussed above, JVM runs the program by using class, libraries and files provided by JRE.

Front

JDK is a super set of JRE, it contains everything that JRE has along with development tools such as compiler, debugger etc.

Back

Each operating system has different JVM, however the output they produce after execution of byte code is same across all operating systems. Which means that the byte code generated on Windows can be run on Mac OS and vice versa. That is why we call java as platform independent language.

Front

So to summarize everything: The Java Virtual machine is the virtual machine that runs on actual machine (your computer) and executes Java byte code. The JVM doesn't understand Java source code, that's why we need to have java c compiler that compiles java files to obtain *class files that contain the byte codes understood by the JVM. JVM makes java portable. Each operating system has different JVM, however the output they produce after execution of byte code is same across all operating systems.

Back

Heap

Front

Heap is a part of JVM memory where objects are allocated. JVM creates a Class object for each .class file.

Back

JVM Vs JRE Vs JDK

Front

JRE is the environment within which the java virtual machine runs. JRE contains Java virtual Machine(JVM), class libraries, and other files excluding development tools such as compiler and debugger. Which means you can run the code in JRE but you can't develop and compile the code in JRE.

Back