Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

Back to your Class roots, continued

Find runtime origins for <em>all</em> loaded classes

  • Print
  • Feedback

Page 3 of 3

Of course, you need to deploy both the modified java.lang.ClassLoader and ClassLoaderRegistry in the JVM's bootstrap classpath (using the -Xbootclasspath/p: JVM option) to make this work. This approach is probably only for dedicated Java hackers.

Finally, if you are willing to forgo pure Java, you can take an entirely different route with the JVM Profiler Interface (JVMPI). Using a JVMPI agent to track classload events is fairly simple to implement. An additional advantage of this approach is the ability to track all classes (bootstrap or otherwise) in the JVM. However, enabling JVMPI places the JVM in an unsuitable mode for production (e.g., it limits the garbage collection modes the JVM can use), so once again you are restricted to testing and debugging.

About the author

Vladimir Roubtsov has programmed in a variety of languages for more than 13 years, including Java since 1995. Currently, he develops enterprise software as a senior engineer for Trilogy in Austin, Texas.
  • Print
  • Feedback

Archived Discussions (Read only)
Subject
. Forum migration complete By AthenAdministrator
. Forum migration update By AthenAdministrator
. nice By Anonymous
Resources