Java Memory Area

Method Area
Method AreaA space created when the JVM starts
A space where Class information, global variable information, and Static variable information are stored
Runtime Constant PoolA space where constants are stored, as the name suggests
Information is shared across all threads
Heap
HeapA space where objects created with the new operator and dynamically created objects such as Arrays are stored
Data stored in the Heap area is not destroyed unless processed by GC
A space where
Reference Typedata is storedInformation is shared across all threads
Stack
StackA space where temporarily used data such as local variables and method parameters are stored
Has a
LIFO (Last In First Out)structure, where data that entered last exits firstIf a local variable is a Reference Type, the address value of data stored in the Heap is stored in the Stack for use
A space where
Primitive Typedata is storedOne exists per Thread
PC Register
PC RegisterA space created when a Thread is created
Registers the address of which instruction the Thread is processing
Serves the role of storing the current position being executed by the JVM
Native Method Stack
Native Method StackA space used when execution of methods written in languages other than Java (C, C++) is needed
Last updated