Java Memory Model (JMM) for Beginners and Advanced Users
summary
Explains concrete Java Memory Model effects: how compilers and the JIT reorder operations despite strong hardware, how store buffer reordering causes visible nondeterminism, and how a GCStress tool reproduces rare cases (e.g., x=0/y=1 on x86). Describes visibility and atomicity rules—final fields provide a final-visibility guarantee, volatile enforces visibility, and atomicity requires AtomicLong or synchronized—and shows measurable costs from padding/cache contention with runnable examples and tests.
AI-written summary · about
chapters (7)
- 0:00Java Memory Model intro
- 5:22Hardware memory basics
- 22:43JMM for developers
- 34:31Visibility and reordering
- 40:58GC Stress Tool testing
- 55:34JMM future and limits
- 1:07:29Summary
related talks
55mMemory Model: Get your shared data under control
01h 04mThe C++ Memory Model
48mHidden Security Features of the JVM - Everything You Didn’t Know and More
43mDon't hack the JVM? ☠️💣💥
44mSecuring the JVM
40mDeterministic Memory Management for Managed Runtimes
01h 33mThe Foundation of C++ Atomics: The Knowledge You Need to Correctly Use C++ Atomics
15mThe life cycle of the mm_struct
