JVM-memory division in the Java virtual machine

JVM-memory division in the Java virtual machine

(JDK1.8) The memory area in JVM is divided into five parts, namely JVM statck, local method stack, heap, method area, and program counter.
1. JVM statck is that after our Java program is running, each of our methods (functions in C language) will open up storage space on this stack-stack frame, and our local variables will also be placed on this stack , The program is destroyed after execution.
2. The local method stack is the memory that our C/C++ program needs to use after running. You must know that the underlying construction of the virtual machine is done by C and C++.
3. heap stored in our objects and references, so-called reference variables can be understood as a memory address value, because the pointer does not exist in Java, so with reference to this term, the array name is a reference.
4. The method area stores static member variables and method tables. The method table is a way to distinguish different methods after compilation.
5. The program counter stores the number of the next instruction. We need to know that there may be higher priority execution during the program running, then the lower priority is forced to stop, and the higher priority execution will continue. Continue execution from the command number stored in the program counter.

Guess you like

Origin blog.csdn.net/qq_45841205/article/details/110782481