Understanding JVM internals

Being a Java developer, we know that Java bytecode runs in a Java Runtime Environment (JRE) and the most important part of the JRE is JVM, which analyzes and executes the Java bytecode. When we create a Java program and compile it, the result is a file with the .class extension. It contains Java bytecode. JVM converts Java bytecode into machine instructions that are executed on the hardware platform where we run our application. When a JVM runs a program, it needs memory to store bytecodes and other information it extracts from loaded class files, instantiated objects, method parameters, return values, local variables, and intermediate results of computations. The JVM organizes the memory it needs into several runtime data areas.

JVM consist of three parts:

  • Class loader subsystem
  • Memory areas
  • Execution engine

The following diagram illustrates the high-level JVM architecture:

JVM architecture

Let's briefly understand the three different parts of JVM we saw in the diagram.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset