Source: http://blog.csdn.net/yu422560654/article/details/7952613
Heap Heap Memory understanding
A JVM instance has only one heap of memory, and the size of the heap memory can be adjusted. After the class loader reads the class file, it needs to put the class files, methods, constants into the heap memory so that the executor executes, and heap memory is divided into three parts:
1. Permanent Space Permanent Storage area
The persistent storage area is a resident memory area that holds the class,interface metadata that is carried by the JDK itself, that is, it stores the required class information for the running environment, the data that is loaded into this area is not reclaimed by the garbage collector, and the memory that is occupied by this zone is freed by shutting down the JVM.
2.Young Generation Space New District
The newborn area is the birth, growth, and extinction area of a class, where a class is generated, applied, and finally collected by the garbage collector, ending life.
The new district is divided into two parts: EdenSpace and the Survivor area (Survivor Pace).
All the classes were created in the Eden District by New. There are two surviving areas: Zone 0 (Survivor 0 space) and 1 (Survivor 1 space). When the space in Eden is exhausted, the program needs to create objects, and theJVM's garbage collector will garbage reclaim the Garden of Eden and destroy objects in the Eden area that are no longer referenced by other objects. The remaining objects in the Garden of Eden are then moved to the surviving zone 0. If the surviving zone 0 is full, then the area will be garbage collected and then moved to Zone 1. What if the 1 districts are full? Then move to the retirement area.
3. Tenure Generation Space Foster Old
The pension area is used to save Java objects that are screened out from the newborn area , and the general pool objects are active in this area. The three districts are as follows:
Go JVM Memory Management-----Heap Memory