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.
The execution of a single threaded program is intuitive as it follows the program order (i.e. the order in which the statements are laid out in the source code).
However, when a program uses several threads and those threads share information, the execution order can become unintuitive due to instructions reordering, partially constructed objects, same variable having different values in different threads because of caching at the CPU level etc.
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, which are defined in the Chapter 17 of the Java Language Specification (JLS), more specifically in section 17.4.