
Suppose the two threads are created on the same object.
So the member variables of that class object are stored in heap whether it is primitive or object.
But there is catch here while storing the local variables(variables declared inside a method of that class). The primitives are stored in the individual thread stack. But if a local variable points to an object, then the reference variable is stored in thread stack while actual object is stored in the heap.
Modern Hardware Architecture:

As you can see above, there are three memory storage units seen.
1)CPU Registers: It is a memory storage inside the CPU.
2)CPU Cache Memory: A cache for each CPU.
3)RAM: The physical memory or you can say the Main Memory.
The CPU can read data from main memory to CPU cache to CPU register or
from directly from main memory to cpu register.
Important thing to note here is that the heap space and the thread stack can be stored in CPU register, CPU cache memory or main memory.
Thanks for reading!!!