How the JVM runs your code
Follow a Java program from source to running machine code: compiling to bytecode, class files, class loading and the class loader hierarchy, bytecode verification, the interpreter and JIT compilers with tiered compilation, memory areas, garbage collection, and tools to look inside, plus how this explains warm-up and startup time.
CodexBash, , 6 min read
"Write once, run anywhere" is Java's most famous promise, and the Java Virtual Machine (JVM) is how it is kept. Your code is not compiled straight into instructions for an Intel or ARM processor; it becomes bytecode for an imaginary machine, and the JVM turns that into real machine code while the program runs, often producing code faster than a straightforward ahead-of-time compiler could, because it can see how the program actually behaves. Our JDK versus JRE versus JVM article introduced the pieces; this one follows a program through them.
Sign in to read the rest
The whole 6 minute article is free with an account, along with every problem, lesson and tutorial. No card.