Java - JVM Specification

https://www.artima.com/insidejvm/ed2/jvmP.html

Each instance of the Java virtual machine has one method area and one heap.

These areas are shared by all threads running inside the virtual machine. When the virtual machine loads a class file, it parses information about a type from the binary data contained in the class file. It places this type information into the method area. As the program runs, the virtual machine places all objects the program instantiates onto the heap

As each new thread comes into existence, it gets its own pc register (program counter) and Java stack

Runtime Areas shared among the threads = Method Area & Heap
Runtime Areas exclusive to each  threads = PC Register, Java Stack, Native Stack

Memory for class (static) variables declared in the class is also taken from the method area.

No comments:

Post a Comment