michael nesterenko
michael nesterenko

Reputation: 14449

classes loaded by jvm

I have a running jvm process and I want a tool to get classes loaded by that jvm, are there one?

Upvotes: 4

Views: 8273

Answers (5)

Jakub Kubrynski
Jakub Kubrynski

Reputation: 14149

You can use jmap -histo <PID>

It'll show histogram of loaded classes including classname, number of instances, size, etc

Upvotes: 12

Erik
Erik

Reputation: 2051

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.

Upvotes: 4

trojanfoe
trojanfoe

Reputation: 122458

If the process has JMX enabled then you can use jvisualvm (bundled with the JDK) to examine such properties.

Upvotes: 0

Umesh Kacha
Umesh Kacha

Reputation: 13686

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

Upvotes: 3

Yuriy Semen
Yuriy Semen

Reputation: 92

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.

Upvotes: 1

Related Questions