Skip to content

Guide

What is the JVM?

The Java Virtual Machine explained at three levels: what it is, what it does when a Java program runs, and how the specification differs from HotSpot, with verified examples and sources.

Java Virtual Machine

JVM specification

An abstract machine defined by the JVM Specification; HotSpot is the implementation shown here.

Simply put

The JVM is the engine that runs Java bytecode. It loads classes, manages memory, runs code (first by interpreting it, then by compiling hot parts to machine code), and cleans up memory that is no longer used.

What a developer sees

You start a JVM with the java command. java -cp out app.Main creates a JVM inside a new operating-system process, loads Main and calls its main method. The program ends when every non-daemon thread has finished, or when something calls System.exit.

Everything your program uses while it runs lives inside that process: loaded classes, threads and their stacks, the heap, compiled code. jcmd <pid> VM.version, jconsole and JDK Flight Recorder attach to a running JVM to show what is inside.

Picture it

Think of a games console. A game made for that console plays on every one of them, whatever television it is plugged into.

The game

Your class files (bytecode)

The console

The JVM

Different televisions and homes

Different operating systems and processors

Where the picture stops working

A console just plays a game as it is. The JVM also checks every class before running it, translates busy code into machine code for its own processor, and manages memory for the program. And it is not a separate box: the JVM is itself a program running on your computer.

Deep dive: the specification and HotSpot in detail

The JVM Specification defines the class file format, the instruction set, loading, linking and initialization, and the run-time data areas — abstractly. It deliberately leaves memory layout, garbage collection algorithms and compilation strategy to implementations (JVMS §2.13). HotSpot, the OpenJDK implementation used by most JDK distributions, is a C++ library (libjvm) with a template interpreter, the C1 and C2 JIT compilers and several garbage collectors. Other JVMs (Eclipse OpenJ9, for example) satisfy the same specification with different internals.

The specification requires

Defines behaviour: what each instruction does, when classes are initialized, which errors are thrown. Says nothing about object layout, GC algorithms or JIT compilers.

HotSpot (JDK 25) does

HotSpot (JDK 25) adds concrete structures you will see dashed in this atlas: Metaspace, the code cache, C1/C2, tiered profiling, G1 regions, TLABs and deoptimization.

Common misconceptions

  • JDK, JRE and JVM are interchangeable names.

    The is the execution engine. A Java runtime () is the JVM plus the class library. The adds development tools such as javac, javap and jcmd. OpenJDK has not shipped a separate JRE since JDK 11; jlink builds custom runtimes instead.

  • Everything in this diagram is required by the specification.

    Only the solid-outlined parts are specification concepts. Dashed parts are HotSpot implementation choices that can change between releases.

Sources

JDK, JRE and HotSpot

JDK

The download developers install: a Java runtime plus tools such as javac, javap and jcmd.

A JDK contains a full Java runtime (the JVM and the class library as a modular runtime image) and development tools: the compiler (javac), disassembler (javap), diagnostics (jcmd, jfr), packaging (jar, jlink, jpackage) and more. Distributions (Oracle JDK, Eclipse Temurin, Amazon Corretto, Ubuntu's OpenJDK…) are mostly built from the same OpenJDK sources.

JDK in the glossary
JRE

A Java runtime without the developer tools: enough to run Java programs, not to build them.

Historically a separate download containing the JVM and the class library. OpenJDK stopped producing a standalone JRE with JDK 11; today runtimes are either a full JDK or a custom, smaller runtime image built with jlink containing only the modules an application needs.

JRE in the glossary
HotSpot

The JVM that ships with OpenJDK and most Java downloads. Its name comes from finding the "hot spots" of a program and compiling them.

OpenJDK's JVM implementation, written mostly in C++ (libjvm). It provides a template interpreter, the C1 and C2 JIT compilers with tiered compilation, several garbage collectors (Serial, Parallel, G1, ZGC, Shenandoah, Epsilon), Metaspace, class data sharing and extensive diagnostics. Everything dashed in this atlas is a HotSpot (JDK 25) structure.

HotSpot in the glossary
JVM Atlas

Explore the machine behind Java programs. A free, open-source atlas of the Java Virtual Machine. Specification baseline: Java SE 25. Implementation details: OpenJDK HotSpot, JDK 25.

MIT licensed · no accounts, no tracking, no backend · your progress stays in your browser.

JVM Atlas is an independent educational project and is not affiliated with or endorsed by Oracle. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.