How the JVM runs your code
Page 1 of the JVM internals cheat sheet covers what happens between a .class file and running code: how classes are loaded, where data lives at run time, and what the execution engine does. Page 2 covers memory and garbage collection.
What's on page 1
- Definitions: JVM, JRE, class loader, runtime data areas, heap, method area, thread stacks and frames, program counter
- Architecture overview: class loader subsystem, runtime data areas (heap, method area, runtime constant pool, code cache, per-thread stacks), execution engine with GC and JIT, and JNI for native libraries
- Class file format: the structure of a
.classfile (magic number, versions, constant pool, flags, interfaces, fields, methods, attributes) and the major version numbers from JDK 1.1 (45) to Java 9 (53) - Class loaders: the bootstrap, extension, system and user-defined loaders, plus the delegation and visibility principles with diagrams
The class loader hierarchy shown is the classic model up to Java 8. Since Java 9 the extension class loader is replaced by the platform class loader, but delegation and visibility work the same way.
Want to go deeper? The JVM Internals & Performance Tuning course covers this hands-on.