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.
No comments yet. Be the first.
Leave a reply