Return to Tutorials index

Java Memory model

Here is my quick intro to the JMM (pdf link).

Further reading: A lot of people think they understand the JMM. None of those people do. Only researchers and compiler writers who happen to have paged all this information in their brains actually get it (hopefully).

This is a good, deeper dive into this subject: Close Encounters of The Java Memory Model

Thankfully, a lot of this edge-case stuff can be ignored in practice ‐ provided you aren't working on any life critical system of course. I created the above diagram and have been hacking Java since '94 but even I don't remember many of these edge cases (no ongoing time to keep this active in my brain).