From Java Concurrency in Practice
Threads share the memory address space of their owning process, all the threads within a process have access to the same variables & allocate objects from the same heap.
Also
Declaring a variable as volatile means that threads should not cache such a variable or in other words should not trust the values of these variables unless they are directly read from the main memory.
My question is
Say there is a non-volatile instance variable 'a' which is modified by a thread. Won't the modified value of 'a' be updated on the heap. If it is updated on the heap another thread reading that instance variable would automatically read the updated value as threads share the instance variables from the heap. So how is the functioning of a volatile variable different?