classes loaded by jvm
I have a running开发者_StackOverflow社区 jvm process and I want a tool to get classes loaded by that jvm, are there one?
You can use jmap -histo <PID>
It'll show histogram of loaded classes including classname, number of instances, size, etc
jinfo <pid>
will give you quite a bit information, including the classpath and the jars in the path. see here
The jinfo command may be limited by the permissions granted to the principal running the command. The command will only list the JVMs for which the principle has access rights as determined by operating system specific access control mechanisms.
Note also that jinfo is not available on windows or linux itanium.
You can use the following in the command line
java -verbose:class ....
and the JVM will dump out what it's loading including all its locations
try visual VM. It is free but is not distributed with JRE/JDK but you can download it from official oracle website. Also you can make a heap dump and than you can view it by standard tools from JDK.
If the process has JMX enabled then you can use jvisualvm
(bundled with the JDK) to examine such properties.
精彩评论