質問

What is run-time constant pool and method-area in java.I read that JVM creates both of them but which one comes first in existence? Also what they contain? Any help will be greatly appreciated.

役に立ちましたか?

解決

As per the http://www.artima.com/insidejvm/ed2/jvm2.html

Method area

Some runtime data areas are shared among all of an application's threads and others are unique to individual threads. Each instance of the JVM has one method area and one heap. These areas are shared by all threads running inside the VM. When the VM loads a class file, it parses information about a type from the binary data contained in the class file. It places this type information into the method area.

Runtime Constant Pool

A class file keeps all its symbolic references in one place, the constant pool. Each class file has a constant pool, and each class or interface loaded by the Java virtual machine has an internal version of its constant pool called the runtime constant pool . The runtime constant pool is an implementation-specific data structure that maps to the constant pool in the class file. Thus, after a type is initially loaded, all the symbolic references from the type reside in the type's runtime constant pool.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top