My colleagues and I have plenty of Java profilers at our disposal, from the free ones included with every JDK to commercial suites. But while the best tool is the one you’ll use, heavyweight profiling tools often get shoved to the late stages of a project when tuning time is short.
XRebel is a lightweight profiler from our JRebel friends for ongoing use during code development. It doesn’t try to be an end-all monitor; rather, it targets a few of the most common trouble spots in Java web apps: SQL performance, session memory, and exceptions. Installation is trivial: just add -javaagent to your container’s VM arguments. It injects an iframe to each of your served pages with a dashboard that flags any problems. From there, you can drill into stack traces and SQLs, and view execution counts and times.
I’ve used XRebel with several web apps, and have demo’ed it to others who have become fans. The new 2.0 Beta adds application code profiling, but I’ve encountered some UI hiccups with the initial beta version. I’m sure those will be fixed fast, and I look forward to the upgrade.
If you haven’t yet tried XRebel, give it a run. It’s so easy to download and enable, there’s no excuse not to try it.