Profiling tools for Java
When your web application developed some months ago, does not perform well or cannot support the number of users hammering at it, profiling is the way to go. Performance tuning is a difficult job and trying to solve it by looking at source code is like trying to throw sticks at a huge beast. So you choose the place to attack very carefully and thats what the profiling tools are designed for.
Till sometime back, the commercial ones like JProbe, OptimizeIt and JProfiler were the only tools of choice, and the open source tools were limited to taking snapshots of Java heap and then looking at the numbers. But now you can save a lot by utilizing open source tools, and some of them even offer features not available in commercial tools. Recently I happened to review the various tools available for profiling a Java web application, and I started out with this big list. I have always liked the complete lists of open sources available at manageability, but the absence of any comparisons makes it difficult to use.
First I shortened the list by cutting down the tools which did not have the following essential features -
- Easy to install and configure
- No modification to existing code
- Profile server side applications
- Decent documentation
- Visual representation of statistics
- Active development
- Dynamic statistics, and not snapshots
Tool | Features | Limitations |
Glassbox |
|
|
Jmemprof |
|
|
GCSpy |
|
|
Eclipse Profiler |
|
|
InfraRED |
|
|
EJP |
|
|
Netbeans Profiler |
|
|
Eclipse TPT Platform |
|
|
jvmstat |
|
|
The recommended tools for profiling are Eclipse TPT (Testing and Performance Tuning) Platform and Netbeans Profiler. Both these tools come close to commercial tools by providing features like memory and CPU profiling both, professional interfaces for drilling down to the problems, visualizations and helpful tutorials. jvmstat is the recommended tool for performance tuning of the JVM.
Glassbox and InfraRED are great tools during application development since they pinpoint possible issues without any code on part of the developer and can point performance problems before the code reaches the QA.