Thursday, 17 November 2011

Profiling Using JRockit Command Line Utility

I was recently involved with a project which was experiencing performance issues relating to high CPU utilization from WebLogic Server. Some further investigation was required in order to ascertain the code that was consuming the CPU cycles. Fortunately WebLogic was running on JRockit, unfortunately there was no fascility to run JRockit Mission Control and remotely attach to JVM and initiate an explicit JRockit Flight Recording.

The solution was to use the jrcmd utility to initiate the recording.

jrcmd start_flightrecording name=cpuprof1 filename=~/cpuprof1.jfr setting=profile duration=300s

The Oracle JRockit Flight Recorder RunTime Guide has further instructions on controlling flight recordings from the command line. The Oracle JRockit Command-Line Reference provides the complete list of options for the command-line.