JDK 11 ClassLoader Hierarchy Details Coming to JCMD

DZone 's Guide to

JDK 11 ClassLoader Hierarchy Details Coming to JCMD

An extremely useful addition is coming to the jcmd tool in regards to the ClassLoader hierarchy. Read this post to learn more!

· Java Zone ·
Free Resource

I've been a fan of the diagnostic command-line tool jcmd, since hearing about jcmd at JavaOne 2012. I've used this tool extensively since then and have blogged multiple times about this tool.

After numerous years of developing with Java, it's my opinion that the ClassLoader is the source of some of the most difficult defects encountered during development and debugging. Given this observation and my interest injcmd, I am very interested in JDK-8203682 ["Add jcmd 'VM.classloaders' command to print out ClassLoader hierarchy details"].

The "Description" for JDK-8203682 states, "It would be helpful, as a complement to VM.classloader_stats, to have a command to print out the ClassLoader hierarchy and ClassLoader details." In other words, this command is to be added tojcmd and would include a display of ClassLoaders in a hierarchical fashion, similar to the way classes are displayed byjcmd's VM.class_hierarchy command.

JDK-8203682 shows its "Status" as " Resolved" and its "Fix Version" as " 11". JDK-8203682 contains three text file attachments that depict the output of jcmd <pid> VM.classloaders: example-with-classes.txt, example-with-classes-verbose.txt, and example-with-reflection-and-noinflation.txt. Additional information is available in the announcement of the change set and in the change set itself.

When dealing with ClassLoader-related issues in Java, any details can be helpful. The addition of theVM.classloaders command to jcmdwill make this command-line tool even more valuable and insightful.

java ,jcmd ,jdk 11 ,feature ,command line interface ,tool

Published at DZone with permission of Dustin Marx , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}