Dave Landers

Dave’s thoughts (such as they are)

Setting up YourKit for WebLogic

Setting up YourKit for WLS is pretty easy, and reasonably clear in their documentation. Since I work with not-yet-released versions of WLS, the automatic configuration scripts for various profilers usually don’t work for me, so I usually configure things manually.

For WLS and YourKit, you just need to do 3 things:

  • Set the library path
  • Set the agentlb option
  • Start the server with debugging off

To do this in Linux, it looks something like this:

$ export LD_LIBRARY_PATH='/opt/yjp-6.0.16/bin/linux-x86-32/'
$ export JAVA_OPTIONS='-agentlib:yjpagent'
$ ./startWeblogic.sh nodebug

Once the server starts, you can connect to it from the YourKit UI, trigger the leak, and take a memory snapshot.

I have been looking for application ClassLoader leaks, and I know that the WLS GenericClassLoader has a String called annotation that holds the application name. So with the snapshot open, I pick Memory -> Strings by Pattern and enter the application name.

I happen to know how the annotation is formatted so I acually search for the regular expression “^myApp@$”. That will find the string, and thus the GenericClassLoader that is leaked. And you can easily see then what is holding the ClassLoader and why it is a leak.

Technorati Tags: ,

2 Comments so far

  1. Denis Richardson November 30th, 2010 9:46 am

    Can you provide instructions for hooking Yourkit to WLS 9.1 and 10.3.

    Specifically, how to accomplish the following task:
    * Set the library path
    * Set the agentlb option
    * Start the server with debugging off

    Thanks in advance for any insight.
    My sincere regards,

  2. dave November 30th, 2010 10:01 am

    Not sure I grok the question, but here goes…

    > * Set the library path:
    $ export LD_LIBRARY_PATH=’/opt/yjp-6.0.16/bin/linux-x86-32/’

    > * Set the agentlb option
    $ export JAVA_OPTIONS=’-agentlib:yjpagent’

    > * Start the server with debugging off
    $ ./startWeblogic.sh nodebug

Leave a reply