Skip to lesson content

Course · 25 available lessons

JVM from the inside out

Build a mental model of the runtime, then follow memory from allocation to diagnosis.

Start exploring →

About this track

This is a small preview of a connected learning experience. Use the contents to move between ideas without losing sight of the bigger picture. Follow a guided sequence.

The learning map

Expand a section to explore its lessons. Numbers follow the full course sequence.

Foundations12 lessons
  1. What the JVM actually is

    Meet the runtime behind your Java program, and get to know the parts that keep it running.

  2. JVM process memory — heap is only one part

    Learn where a JVM process uses memory, why a healthy heap can coexist with a container OOM, and which evidence to collect first.

  3. Object layout inside the heap

    See what a Java object actually contains in memory, why its fields do not determine its full size, and where headers, references, and alignment fit.

  4. GC roots, reachability, and why GC is graph traversal

    Follow references from the root set to discover live objects, understand collectible cycles, and diagnose unwanted retention.

  5. Mark-Sweep vs Mark-Compact vs Copying GC

    Compare three foundational reclamation strategies, and see how fragmentation, object movement, and survival rate shape GC design.

  6. Generational GC — Eden, Survivor, and promotion

    See how object lifetimes shape young collection, survivor copying, promotion, and the references that connect generations.

  7. Write barriers, card tables, and remembered sets

    See how HotSpot tracks reference changes so collectors can find incoming references without repeatedly scanning the entire heap.

  8. TLABs and why object allocation is usually very cheap

    See how HotSpot turns ordinary object allocation into a mostly thread-local bump-pointer operation, and why allocation rate, allocation cost, and retention are different questions.

  9. Escape analysis and scalar replacement

    See how HotSpot can prove that some Java objects need no heap allocation, preserve their fields as scalar values, and remove unobservable locking.

  10. Class loading lifecycle — from .class bytes to a live JVM class

    Follow a class through loading, linking, and initialization, and connect runtime type identity to HotSpot metadata and class-loader lifetime.

  11. The constant pool and why JVM bytecode uses symbolic references

    Open a class file, decode its numbered constant-pool entries, and follow a field or method reference into the running JVM.

  12. Stack frames, local variables, and the operand stack

    Follow a method's values through indexed local slots, its operand stack, and the calls that build a thread's logical JVM stack.

Execution and JIT5 lessons
  1. The HotSpot interpreter — executing bytecode before JIT compilation

    Build an interpreter from a small loop, trace JVM stack-machine instructions, and see how a running loop can move into compiled code.

  2. Tiered compilation — C1, C2, and why HotSpot compiles a method more than once

    Follow one Java method as HotSpot interprets it, compiles it with C1, learns from it, and may compile it again with C2.

  3. Speculative optimization and deoptimization

    Follow one optimized Java call as HotSpot bets on common behavior, detects when reality changes, and safely continues execution.

  4. The Code Cache — where JIT-compiled machine code lives

    See where HotSpot stores compiled native code, what an nmethod contains, how compiled code is managed over time, and why Code Cache pressure can affect application performance.

  5. Safepoints — when HotSpot needs Java threads in a known state

    Understand how HotSpot coordinates Java threads for global VM operations, how compiled code cooperates, and why reaching a safepoint is distinct from doing work at one.

Threads and Synchronization4 lessons
  1. Thread-local handshakes — coordination without stopping the whole JVM

    See how HotSpot coordinates runtime work with selected Java threads, using safe states and thread-local polling without requiring a global safepoint.

  2. Platform threads vs virtual threads in JDK 25

    Separate Java thread identity from execution resources, follow a virtual thread through blocking and resumption, and understand what carriers and heap-managed stacks change.

  3. synchronized internals — lightweight locking and monitor inflation

    Follow intrinsic synchronization from JVM monitor semantics through JDK 25 HotSpot lightweight locking, contention, wait sets, and virtual-thread state.

  4. ReentrantLock, AQS, and parking

    Follow an explicit Java lock from its atomic fast path through AQS queueing, conditions, parking, virtual threads, and contention diagnosis.

Garbage Collection4 lessons
  1. GC foundations — tracing, reclamation, and compaction

    Follow reachable objects from GC roots, then see how sweeping, compaction, and evacuation turn liveness information into reusable heap space.

  2. Generational GC — young collections, promotion, and remembered sets

    Follow a young collection from roots through remembered references, survivor evacuation, and promotion without scanning the whole old generation.

  3. G1 internals — regions, evacuation, concurrent marking, and mixed collections

    Follow a G1 collection set from roots through evacuation, then see how concurrent marking selects old regions for mixed collections.

  4. G1 SATB — marking while the application keeps changing the heap

    See how G1 preserves overwritten references during concurrent marking, why buffers and TAMS matter, and what Remark finishes.