Java / JVM Architecture (Java21) Interview questions
What is the Runtime Data Area in JVM?
The Runtime Data Areas are the memory regions the JVM sets up to run a program, created when the JVM starts (or per thread) and torn down when the JVM, or that thread, exits.
| Area | Shared or per-thread? |
| Method Area | Shared across all threads |
| Heap | Shared across all threads |
| JVM Stack | Per-thread |
| PC Register | Per-thread |
| Native Method Stack | Per-thread |
The shared areas (Method Area and Heap) hold class metadata and objects that every thread can see, while the per-thread areas track each thread's own call stack and execution position.
More Related questions...