Difference between JVM runtime constant pool and static constant pool

    I recently learned the principles of JVM and encountered the area definition of the runtime constant pool, which is part of the method area of ​​the JVM runtime memory model. The overall distribution is as follows:

 

As shown below: The overall distribution is as follows

The runtime and static constant pools are part of the method area. Generally, I usually refer to the runtime constant area. What is the difference between it and the static constant area?

 

 

 

Personally think that the static constant pool is to store the data of each literal value and symbol reference after parsing each class file loaded into the memory, and the runtime constant area is to aggregate all the static constant data together (fuzzy to Say).

From the bottom level to the assembly level, each data in the memory does not have the concept of a class. Each time it is a call of a class and a method, which is equivalent to the relative index addressing process of the register.

(Are #1 #2 in the above picture the symbols for calculating the actual address?)

The runtime method area is to use the unique identifier of each class as its segment address (DS), and the internal variable field methods are all offset addresses (BX), and the relative positioning of these field methods when they are actually pushed into the stack and executed. Characters, etc. are parsed into real addresses, so as to enter the CS IP to be recognized and executed; then further guess whether the concept of java's permission package can also obtain all the class information for further control after summarizing it.

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326928380&siteId=291194637