Java Virtual machine memory can be divided into exclusive and shared areas.
Exclusive zone: Virtual memory stack, local method stack, program counter.
Shared area: The method area, Java heap (used to hold object instances).
Program counter
Compared to a small memory space, the line number indicator of the byte code executed by the current thread, if executed as a Java method, the counter records the address of the executing virtual machine bytecode instruction, or undefined if the method is the native method.
Virtual Machine Stack (Java Method Service for JVM execution)
The data that is run when the method is stored describes the dynamic memory model that the method executes.
Stack frame: Each time the method executes, a stack frame is created, and the stack frame is started to execute. If other methods are called, a stack frame is created, followed by the stack's advanced first.
Local Variables Table: stores the various data types known to the compiler, and the size does not change because only references are stored.
Java Virtual machine Memory tips