8

It'd be handy to know which classes are currently loaded by a given JVM instance.

Is there some way to get them through JVisualVM, for instance?

Edit: I'm aware of the solution given @ Java - Get a list of all Classes loaded in the JVM, yet I'd like to know if there's a way to do that through JVisualVM or some other tool. At the moment I'm working against a RCP application, and I'd prefer to not having to run the application through the java tool (I'm lazy, yes).

Community
  • 1
  • 1
devoured elysium
  • 101,373
  • 131
  • 340
  • 557
  • Possible duplicate of [Java - Get a list of all Classes loaded in the JVM](http://stackoverflow.com/questions/2548384/java-get-a-list-of-all-classes-loaded-in-the-jvm) – Greesh Kumar Aug 23 '16 at 12:14
  • Try YourKit Profiler: https://www.yourkit.com/docs/java/help/classloading.jsp . There is a trial version that you can give a shot. – JohnTortugo Dec 28 '22 at 16:39

2 Answers2

0

Did you try jconsole?

Jconsole should be able to display list of loaded classes, see jConsole Documentation.

See the Viewing Overview Information section, the screenshot shows number of loaded classes. Plus, you can see a tab called Classes, this is where the class loading info is.

Aleš
  • 8,896
  • 8
  • 62
  • 107
0

You can do this with VisualVM:

  1. $JAVA_HOME/bin/jvisialvm
  2. Select your jvm app -> Sampler -> Memory -> click "Heap Dump"
  3. Open created Heap dump -> click "Classes". Where is a search field at bottom.

Your are welcome.

Pavel
  • 424
  • 3
  • 12