Monday, July 19, 2010

Btrace, get error java.lang.IllegalArgumentException: null ClassLoader when profiling jrockit jvm

As I mentioned in this Blog  Oracle Coherence, Make sure the filter is using the index you created , Btrace is a great tool to tell whether Coherence query is picking up the index or Not. for that case, I just use the Sun hotspot JVM as an example.

If you use Btrace to profiler the jrockit-based cache member, you may get the following errors. ( I tested on windows, no error, but the trace logic never get hit, on Linux get the Null calssloader error.)

java.lang.IllegalArgumentException: null ClassLoader
    at sun.misc.Unsafe.defineClass(Native Method)
    at com.sun.btrace.BTraceRuntime.defineClassImpl(BTraceRuntime.java:1872)
    at com.sun.btrace.BTraceRuntime.defineClass(BTraceRuntime.java:366)
    at com.sun.btrace.agent.Client.loadClass(Client.java:214)
    at com.sun.btrace.agent.RemoteClient.<init>(RemoteClient.java:60)
    at com.sun.btrace.agent.Main.startServer(Main.java:333)
    at com.sun.btrace.agent.Main.access$000(Main.java:61)
    at com.sun.btrace.agent.Main$1.run(Main.java:140)
    at java.lang.Thread.run(Thread.java:619)

Conclusion.
      the Btrace utility doesn’t support jrockit jvm based profiling.

Then How to trace jrockit jvm to to makre sure filter is using the index we created? the short answer is they have a powerful profiling tool called Mission Control.

when you load up the Misson control and connect the cacheserver node. Right click and select “Start Console “

Go to the advanced tab.
  Add one profiler class, “com.tangosol.util.SimpleMapIndex”. then pick up the method we are interested.
image 

then click to run the profiling.
  >>do you insert /update, query, addindex/remove index. you will see the counter keep changing. From the statistics counter, you might know which method get called or not. their performance in terms of timing. and their loading in terms of req/s

image

 
Locations of visitors to this page