Short answer
The heap is a single shared region where all objects and arrays live; it is managed by the garbage collector and is where GC pauses happen.
Explanation
The stack is per-thread: each thread has its own stack of frames holding local variables, operand values, and return addresses, freed automatically when a method returns (LIFO). Primitives and object references sit on the stack, but the objects they point to live on the heap. Stack overflow (deep recursion) throws StackOverflowError; exhausting the heap throws OutOfMemoryError: Java heap space.
Common mistakes
- Saying objects can live on the stack.
- Saying the stack is shared between threads.