Java Virtual Machine

Hand-drawn terracotta lattice of rectangular cells, outlined on the left and filled with denser terracotta hatching toward the right, over horizontal sand, umber and moss strata.

The Java Virtual Machine (JVM) is the abstract computer that runs bytecode, the instructions stored in compiled Java class files (Lindholm et al., 2025a). The file format is independent of hardware and operating system. Running the bytecode requires a Java runtime that supports the class file version (Lindholm et al., 2025a; Gosling & McGilton, 1996b). Library upgrades can break programs, and short garbage collection pauses can coincide with longer application response times (Ochoa et al., 2022b; Cai et al., 2022).

What makes bytecode portable

A class file’s version numbers indicate which release of the Java Platform, Standard Edition (Java SE) it depends on (Lindholm et al., 2025a).

An application can still rely on platform-specific code. The Java Native Interface lets Java code use libraries written in other languages (Oracle, n.d.j). Early Java team member Arthur van Hoff recalled that using each system’s own controls made it difficult to get consistent behaviour across systems (van Hoff, 1998).

What can break when code changes

The Java Language Specification calls a change binary compatible if existing compiled code that linked before can still link without errors. Linking connects compiled code to the classes and methods it refers to (Gosling et al., 2025a).

Library upgrades and whole-project builds

Studies of Maven Central, a repository of published libraries, differ on how reliably version numbers warn of breaking changes. Semantic versioning is a scheme in which version numbers are meant to signal breaking changes. One study counted releases that introduced breaks. A replication measured compliance with semantic versioning and estimated how many clients were affected (Raemaekers et al., 2017; Ochoa et al., 2022b).

What the study countedWhat it found
Library releases analysed in the original Maven Central studyAbout one third contained at least one binary breaking change (Raemaekers et al., 2017).
Library upgrades analysed in the Maven Central replication83.4% complied with semantic versioning (Ochoa et al., 2022b).
Clients of libraries in the replicationAn estimated 7.9% of the clients analysed were affected by a breaking change (Ochoa et al., 2022b).
Updates to outdated Maven dependencies in a recompilation study11.58% resulted in a breaking change that affected the client (Jayasuriya et al., 2025).
Local builds of sampled Java projects on GitHub across Java Development Kit (JDK) versionsAutomated build success ranged from 30% to 44% among tested JDKs from Java 8 onward. It peaked at JDK 17 (Sulír et al., 2026).

What threads can see in shared memory

The Java memory model limits the behaviours that threads, or separate sequences of execution, can observe when they share data. In a correctly synchronised program, the result appears as if the threads took turns in a single order that preserves each thread’s own order. The specification calls this appearance sequential consistency (Manson et al., 2005; Gosling et al., 2025b).

Java 5 revised the memory model. Under the previous rules, a field declared final, meaning it can only be assigned once, could appear to change after being set. The previous rules also interfered with common compiler optimisations (Manson et al., 2005; Manson & Goetz, 2004). A later analysis that checked the rules with a proof tool identified places in the specification that needed clarification or correction (Lochbihler, 2014).

HotSpot and warm-up

HotSpot is one JVM implementation. It normally starts by interpreting bytecode, which means carrying out its instructions directly. It compiles frequently executed methods into instructions for the host computer while the program runs. This is just-in-time compilation (JIT) (Oracle, n.d.e).

A microbenchmark, a test of a small piece of code, can take time to reach stable speed. That early period of changing speed is called warm-up. In one study, 43.5% of Java microbenchmarks had mixed results across independent runs. Some runs reached stable performance and others kept varying (Traini et al., 2023).

Garbage collection and response time

The JVM uses a garbage collector to reclaim storage in the heap, the area of memory where objects are stored. The specification leaves the choice of collector to each JVM implementation (Lindholm et al., 2025b).

Short collection pauses can coincide with slower application responses. In a test of five OpenJDK 17 collectors, newer collectors designed to keep pauses short sometimes gave worse response times than collectors that paused the application for collection (Cai et al., 2022). A separate OpenJDK benchmark with a moderately sized heap found that the optimised LXR collector cut total execution time by 11% compared with the default G1 collector (Zhao et al., 2025a).

Security controls

The Security Manager was a Java mechanism for restricting what code could do. A study of open-source Java applications that interacted with it found that developers regularly misunderstood or misused Java security controls. JDK 24 permanently disabled it (Coker et al., 2015; Oracle, 2025f).

Deserialisation reconstructs objects from stored or transmitted data. An audit of 104 reported Java deserialisation vulnerabilities found that some were addressed with incomplete fixes or workarounds (Sayar et al., 2023). The Java 11 documentation describes a general-purpose filter that applications have to configure before it applies (Oracle, n.d.k).

Further reading

Known gaps

What this article cannot tell you yet.

  1. The performance studies do not establish how warm-up, memory use or response times have changed across successive Java releases.
  2. The article does not estimate how often applications encountered Java deserialisation vulnerabilities.

References

Solid source
Rated highly trustworthy by the research, and every passage taken from it was found in it.
Weak source
Rated low, or a passage taken from it was not found in it.
Medium trust
Rated medium by the research.
Not checked
Rated high, but its passages could not all be checked against it.
Show all 22 references