JVM runtime data area - Java virtual machine stack

        Each thread will create a Java virtual machine stack when running, which is also private to the thread. It contains stack frames one by one, first in last out, corresponding to each method call, and will pop up after running, so there is no problem of garbage collection .

The stack frame contains :

  • The local variable table stores local variables in the method. For variables of basic data types , directly store their values . For reference data types , store references to object addresses .

  • Operand stack, all calculations are done in the operand stack.

  • Dynamic linking, because constants in the class may need to be used in the method , a reference to the constant pool is required .

  • The return address of the method. After the stack frame (method) is pushed onto the stack, it needs to return to the place where the call was started until the execution is completed .

 

 

Guess you like

Origin blog.csdn.net/m0_62565675/article/details/131777011