Top "Java-memory-model" questions

The Java Memory Model (JMM) describes which executions of a program are legal by determining what value(s) can be observed when reading a shared variable according to certain rules.

Why does this Java program terminate despite that apparently it shouldn't (and didn't)?

A sensitive operation in my lab today went completely wrong. An actuator on an electron microscope went over its boundary, …

java concurrency java-memory-model memory-visibility
What does "volatile" mean in Java?

We use volatile in one of our projects to maintain the same copy of variable accessed by different threads. My …

java volatile java-memory-model
What is in Java object header?

Could you give me some information on what is exactly stored in object header? I know, that it's probably JVM …

java jvm java-memory-model object-layout jol
How can CopyOnWriteArrayList be thread-safe?

I've taken a look into OpenJDK source code of CopyOnWriteArrayList and it seems that all write operations are protected by …

java data-structures concurrency java-memory-model
Memory effects of synchronization in Java

JSR-133 FAQ says: But there is more to synchronization than mutual exclusion. Synchronization ensures that memory writes by a thread …

java concurrency jvm java-memory-model
Instruction reordering & happens-before relationship in java

In the book Java Concurrency In Practice, we are told several time that the instructions of our program can be …

java multithreading concurrency java-memory-model
Must all properties of an immutable object be final?

Must immutable objects have all properties be final? According to me not. But I don't know, whether I am right.

java immutability final java-memory-model
String pool is created in PermGen area or Object area of Heap

HERE, author is saying that 3) String pool is created in PermGen area of Heap, garbage collection can occur in perm …

java string jvm java-memory-model
What is a TLAB (Thread Local Allocation Buffer)?

I couldn't find a comprehensive source that would explain the concept in a clear manner. My understanding is that a …

java garbage-collection java-memory-model
Volatile guarantees and out-of-order execution

IMPORTANT EDIT I know about the "happens before" in the thread where the two assignments are happening my question is …

java volatile java-memory-model