Understanding of the Java Virtual machine stack
The virtual machine stack is the stack memory we know, and the stack memory is unique to the thread. The reference type stored in the local variable table in the stack memory is simply the memory address of the storage object. The object is created in heap memory, which is the object in the threads shared area.
Local Variables table: The memory space of a local variable table is allocated at compile time, and is used to hold the various basic data types, reference types, and Returnadress types known during compilation. Is the stack memory we know.
Analog Stack Memory Overflow
When a method is called repeatedly in a thread, because the execution of the method allocates a fixed amount of memory in the frame, the method is constantly called (the previous method does not perform the popup stack), and the fixed-size memory is created continuously in the frame. This will cause
Stackoverflowerror error is reported. If you do not limit the size of the stack memory for each thread, you will get an error outmemoryerrror when the stack is unable to ram the virtual memory. The simulation code is as follows:
Stack Memory Overflow Explanation:
Deep understanding of Java Virtual Machine---Java Virtual machine memory management (VI)