As part of our consulting activity, we need a tool to help us track performance issues.
A profiler seems to be the perfect suit for this. So I performed a small survey to find the best tool for our needs.
Mainly we are interested in:
- method calls profiling
- threads contentions profiling including with latest java.util.concurrent
- memory snapshot comparison and dynamic memory usage monitoring
Most of available tools are based on instrumentation which might slightly modify performances of your program (known as Heisenbug). For this survey we neglected this impact as main performance issues are still visible when using instrumentation based profiling.
For a more complete description of impacts of instrumentation refer to this discussion.
Here are my remarks regarding some of the main tools available, both commercial and open source.
VisualVM 1.1.1 and Netbeans profiler
- No details on blocked threads.
- History and threads states not useful. (http://profiler.netbeans.org/issues/show_bug.cgi?id=55211)
- No support for java.util.concurrent
Netbeans profiler adds the concept of profiling points and provides integration with source code.
Other concepts are similar.
- Supports automatic deobfuscation (http://www.yourkit.com/docs/80/help/summary.jsp)
- Keep traces of all exceptions thrown
- No j.u.c support (http://forums.yourkit.com/viewtopic.php?f=2&t=2901). Can be simulated with wall time feature but not easily.
- Used by our customers.
- Monitor profiling supports java.util.concurrent (reported as blocked threads when waiting).
- Poor documentation.
- No forum.
Appperfect Java Profiler
- Apparently needs a specific agent (only available under Linux?) to profile a remote application.
- Not very clear from documentation.
- Pretty basic, no dynamic profiling
- Interesting statistics on exception thrown (rates)
- Apparently demo version not available for France. Didn’t investigate.
- No evaluation version available.
- Didn’t have any answer from sales representative.
So far my tool of choice is JProfiler, mainly because it supports java.util.concurrent features. I would rather switch to Yourkit if this was supported out of the box for the ease of use and exception feature.