First, the JVM divides the memory structure
1. Program Counter: Record method program execution card.
2. Local stack: Bring your own. (different OS will have different local method stacks)
3. Method Area: We define methods in the class all exist in the method area, divided into static method area, non-static method area.
4. Stack memory: Local variables are stored in the method, and local variables disappear as the scope disappears.
5. Heap Memory: Stores arrays and objects (something new is put out).
Attention:
Stack: The variables inside are not initialized by default, and if you want to apply the variables inside the stack, you must initialize them manually.
Heap: There will be default initialization in the space.
Second, the memory is divided into three generations
1. Young Generation (Eden District, Survice District)
2. Old Quarter
3. End-of-the-old
Java Basic Supplement (JVM partition Memory)