Java program execution memory processing process
We need to know not only what we learn, but also why. Your salary must be in direct proportion to your learning depth.
In the past, we learned how to develop a program and have some development experience. But how does a program run in the memory?
1. First, let's look at a picture.
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHA + expires/ydLUutzH5bP + expires + 78tXf19a3 + expires + CnW0MHLoaMKPHA + CiA8L3A + CjxwPgozoaK + expires/expires = "brush: java; "> public static void main (String args []) {Point p = new Point (1, 2, 3);} class Point {int x, y, z; point (int _ x, int _ y, int _ z) x = _ x; y = _ y; z = _ z ;}
The running process of this program is as follows:
- Load the program from the hard disk to the memory area
- Locate the main method and start execution.
- Memory Management During Program Execution
The local variable p appears in the stack memory;
The data zone appears in the heap memory;
The p pointer in the stack points to the corresponding data zone in the heap ..