Friday, January 29, 2010

Mycila Unnecessary Jar Detector

I've released a new project: Mycila UJD (Unnecessary Jar Detector).
This library is a useful tool which enabled you to detect used and unused classes, jars, classloaders at runtime.
It works like a java agent (but does not affect performance since does not enhance anything), and publish two MBeans accessible through any JMX Console like Visual VM.
From there you can analyze the classes, in example, when running on an application server, you can filter per webapp classloader and see what is used and unused.

2 comments:

  1. How do you use this with Tomcat?
    what do I have to modify in the Tomcat start up Script?
    ReplyDelete
  2. It is like JBoss. See http://code.mycila.com/wiki/MycilaUJD.
    You can then use the method getLoaderName to get your classloader by provinding a package name:

    getLoaderNames("com.mycompany.app")

    and call each other methods with the classloader name you've found.
    ReplyDelete