JVM.Advanced.Specification

🔥 Love this question — it shows you’re thinking at system design level!


📜 1. What is the JVM Specification?

The JVM Specification (or JVM Spec) is an official document maintained by Oracle. It defines:

What the JVM must do — the rules, behaviors, and guarantees a compliant JVM must follow.

It does NOT define how the JVM should do it — the internal design (like GC algorithms, JIT techniques, memory layouts, etc.) is up to each JVM implementation.


🔗 Example:

The spec says:

“Each class must have a method area where class metadata (fields, methods, etc.) is stored.”

But it does NOT say:

“This area must be called Metaspace, or it must use native memory, or it must use a linked list.”

👉 The spec defines the contract.
👉 Each JVM implementation is free to choose how to fulfill that contract.


🌍 2. Popular Implementations of the JVM Spec

These are real-world JVMs that follow the spec (each with their own designs, optimizations, and trade-offs):

ImplementationMaintainerNotes
HotSpotOracleThe default JVM in most OpenJDK distributions (including Oracle JDK). Uses Metaspace (Java 8+).
OpenJ9Eclipse Foundation (originally IBM)Designed for fast startup and low memory footprint. Popular in cloud environments.
GraalVMOracleModern polyglot JVM that can also compile Java to native executables (ahead-of-time compilation).
Zing (Azul Platform Prime)AzulTuned for low-latency and large heap sizes (popular in financial trading systems).
Dalvik/ARTGoogleJVM-like systems for Android, optimized for mobile devices. (They follow a modified version of the JVM spec.)
Kona JVMAlibabaHigh-performance JVM optimized for Alibaba’s e-commerce infrastructure (big in China).

🔥 3. Key Takeaway

LevelMeaningExample
SpecificationThe “what” – rules all JVMs must followJVM Spec says: “You must have a class loader, method area, heap, stack, etc.”
ImplementationThe “how” – how a specific vendor implements the specHotSpot uses Metaspace for class metadata; OpenJ9 has a different design

💡 Fun fact:

The JVM Spec evolves with each Java version. For example, Java 21 (LTS) adds features like virtual threads and changes the specification to reflect those.


🚀 Quick analogy:

  • JVM Spec = recipe book (what the dish must taste like)
  • HotSpot/OpenJ9/GraalVM = different chefs (each uses different ingredients and techniques to make the same dish)
This entry was posted in Без рубрики. Bookmark the permalink.