首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

【转】JVM阅览:HotSpot source: classloading

2012-09-20 
【转】JVM阅读:HotSpot source: classloadingHotSpot source: classloading?In the past, I wrote about Jav

【转】JVM阅读:HotSpot source: classloading

HotSpot source: classloading?

In the past, I wrote about Java class loading in these entries:

Understanding Java class loadingUnderstanding Java class loading - part 2Now, if you have downloaded JDK source from?http://jdk6.dev.java.net?and you want to understand classloading in HotSpot JVM, you may want to look at these files:$JDK/src/share/vm/runtime/classFileParser.hpp (and .cpp)$JDK/src/share/vm/runtime/classFileStream.hpp (and .cpp)$JDK/src/share/vm/memory/classLoader.hpp (and .cpp)$JDK/src/share/vm/memory/systemDictionary.hpp (and .cpp)$JDK/src/share/vm/memory/loaderConstraints.hpp (and .cpp)$JDK/src/share/vm/oops/InstanceKlass.hpp (and .cpp) - in particular?bool instanceKlass::link_class_impl?methodYou may want to refer to?Dynamic Class Loading in the Java Virtual Machine?as well. A good to way to learn classloading is to trace JVM using?DTrace?on?Solaris OS. There is a?hotspot::class-loaded?probe. For example, on class-loaded probes, you may call?jstack?action to print stack trace whenever a java class is loaded (or unloaded). If you are reading (and planning to hack!) HotSpot sources, you may want to try these as well:
    HotSpot is a C++ program. You can try what is described in "Using DTrace to Profile and Debug A C++ Program"Insert your own?USDT?probes in HotSpot source and recompile! [refer:?User-land tracing gets better and better]

Note that aforementioned DTrace tricks can be used to trace any subsystem of HotSpot - not neccesarily classloading!

?

A. Sundararajan's Weblog?

A. Sundararajan's Weblog -- sundararajan

热点排行