jubincn

导航

JVM中存储类信息的三个表格

摘自:《Java Performance》第三章

Internal Class Loading Data

The HotSpot VM maintains three hash tables to track class loading. The SystemDictionary contains loaded classes, which maps a class name/class loader pair to a klassOop. The SystemDictionary contains both class name/initiating loader pairs and class name/defining loader pairs. Entries are currently only removed at a safepoint. Safepoints are described in more detail in the “VM Operations and Safepoints” section later in the chapter. The PlaceholderTable contains classes that are currently being loaded. It is used for  ClassCircularityError checking and for parallel class loading for class loaders that support multithreaded class loading. The LoaderConstraintTable tracks constraints for type safety checking. These hash tables are all guarded by a lock; in the HotSpot VM it is called the SystemDictionary_lock. In general, the load class phase in the HotSpot VM is serialized using the Class loader object lock.

posted on 2013-08-05 18:52  jubincn  阅读(198)  评论(0编辑  收藏  举报