Diagram of Java and function calls
"Noun explanation"
--->java is a thread of private space
--->java is an advanced data structure. function returns, the function's time frame is ejected.
---> A function corresponds to a space frame, a single frame contains a local variable table, operand, the data area
"Behavioral Interpretation"
---> Each function call will generate a corresponding time frame, thus occupying a certain amount of space, because there is not enough space, function calls naturally cannot continue. The system throws a Stackoverflowerror overflow error when the requested depth is greater than the maximum available depth
exception
---> Memory overflow java.lang.StackOverflowError
"Parameter Setting"
--->-xss128k represents a thread with a maximum space of 128K
"The content explained"
"Local Variables Table"
---> Save local variables, parameters of the indicated function. The more local variables and parameters of the function, the larger the frame, the more space occupied, affecting the number of nested calls of the function.
--->long and double types of local variables occupy 2 characters.
--->int,short,byte, object references, and so on 1-word size
---> Words: A set of binary strings in computer memory that occupy a single memory unit number. The length of a word 4 bytes on a general 32-bit computer
---> Each local variable table has: Scope range, slot (index, variable name, data type) behind the variable slot can be reused in front of the slot that has lost the scope variable, to achieve space-saving purposes.
/**
*
* @param a
* @param b
* Local variable 0 in table: this, a,b,c,d
* Slot: This (0), a (1), B (2), C (3), D (4)
* The size of the station word is: 5 words
*
*/
public static void Test1 (String a,int b) {
int c=0;
System.out.println ("Test2.test1 ()" +c);
Long d=2;
}
/**
*
* @param a
* @param b
* Local variable 0 in table: this, a,b,c,d
* Slot: This (0), a (1), B (2), C (3), D (3)
* The size of the station word is: 4 words
*/
public static void Test2 (String a,int b) {
if (true) {
int c=0;
System.out.println ("Test2.test2 ()" +c);
}
int d=2;
}
"Operating Hours"
---> operand is also one of the important contents in the time frame, mainly saving the intermediate results of the calculation process, as well as the temporary storage space of variables in the calculation process.
---> Advanced post-out data structure
"Frame Data Area"
---> Access constant pool pointers for easy program access to constant pools
---> Exception handling tables. When an exception occurs in the program, the corresponding exception is found according to the table and processed
Allocation on the residence:
---> is an optimization technique provided by the Java Virtual machine, and the basic idea is that for those objects that are private to the thread (which means objects that cannot be accessed by other threads), they can be scattered and allocated to the place of stay instead of being allocated on the heap. The benefit of allocation on a stay is that it can be destroyed at the end of a function call without the need for garbage collector intervention to improve system performance.
A technical basis for allocation on---> is the escape analysis. The purpose of the escape analysis is to determine if the object's scope is likely to escape from the function body.
(3) Java