Recent articles on TheServerSide.com have discussed some of the challenges of troubleshooting and debugging Java code, much of which has focused around the futility of working with the de facto tool for troubleshooting your Java code – the infamous stack trace. But when it comes to tracking down problems, monitoring your code, performing debugging and even setting yourself up to avoid future performance problems, there are a variety of great tools available to help you troubleshoot. Here’s a look at a few of the most popular troubleshooting tools and how these tools can help you.
Sun’s JConsole monitoring tool is included with the Java Developers Kit 5.0. It leverages the Java virtual machine’s comprehensive instrumentation to deliver real-time information on resource utilization and consumption and total application performance. JConsole accesses core functionality for monitoring and managing the Java platform including:
- Memory status – detection of low memory
- Manages verbose tracing of GC and class loading (enable/disable)
- Detection of programming deadlocks
- Control of any loggers running in the application
- Access Sun's platform extension to manage operating system resources
- Manage Java Beans
VisualVM runs on Oracle and Sun JDK 6 to monitor Java applications and troubleshoot performance issues. It utilizes available Java technologies, including jvmstat, Serviceability Agent (SA), and JMX, to automatically gather data using the most efficient method possible so that the least amount of system overhead is imposed on the application. Its default features meet the needs of system developers and administrators, and enables application users to submit comprehensive bug reports. The tool is useful for production and development phases and expands the Java platform’s capability to monitor and analyze performance.
Hewlett Packards’ HPjconfig is a tool for configuring Java kernel parameters to meet your application’s requirements when under HP-UX 11i on the HP 9000 PA-RISC system and other compatible systems. HPjconfig recommends kernel parameters and provides save and restore functions to enable distribution of those recommendations to application users. Informed of the exact Java and HP-UX versions to be analyzed, HPjconfig will confirm that the latest patches are installed to ensure maximum performance. Any missing or superseded patches are highlighted for easy identification and resolution.
HeapAnalyzer from IBM detects Java heap leaks using heuristic search analysis of the heap dump in the application. HeapAnalyzer parses the Java heap dump to produce directional graphs then transforms those into directional trees.
An open source tool, GCViewer, lets developers visualize data from verbose garbage collection on Sun and IBM virtual Java machines. You can maximize the performance of your garbage collector using metrics provided by GCViewers, including throughput, longest pause, accumulated pauses and others. Better garbage collection will increase application performance as well.
Java Out-of-Box Tool installs startup scripts that configure system tuning parameters to deliver better “out-of-box” performance. Upon installation, the software modifies kernel parameters, rebuilds the kernel, and then executes a system reboot.
By taking advantage of Java monitoring and performance tuning tools, developers can expect to see consistent application performance across all hardware and operating systems.