RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


DTrace and Java: Exposing Performance Problems That Once Were Hidden

The combination of DTrace and Java SE 6 enables an unprecedented view across all layers of Java software. Learn how to leverage the combo to gain tremendous insight into your Java applications, the JVM, or any other aspect of the software.

ou very rarely hear "quality of life" and "developer" in the same sentence. This is mostly because developers lack tools (not skills) that easily and concisely allow them to identify transient failures (performance problems) in complicated software stacks. Java developers, however, finally have a tool combination that allows for an unprecedented view across all layers of software that are involved in business applications—DTrace and Java SE 6. Time to find a new hobby to fill your free time.

Understanding the performance characteristics of software has always been notoriously difficult. This is especially true of languages such as Java. Developers all knew what they should be looking for, but few (if any) tools enabled them to easily test out their hypotheses. Each of the available tools fell short in some respect. The probe-effect was too high and changed the behavior of the application, or there was no seamless mechanism to observe the multiple layers of software simultaneously (Java code, JVM, native code, and the kernel), or you had to modify or restart your applications to perform the tests—which all but prevented you from debugging production performance issues.

The situation became much better for native code users (C, C++) with the release of Solaris 10 and DTrace. DTrace allows for the dynamic instrumentation of an application (meaning you can deliver fully optimized binaries and DTrace will do the instrumentation when an experiment is run) and the ability to collect arbitrary data about the application. In addition, DTrace allows for the simultaneous observation of both user-land applications and the kernel from a single tool.

However, analyzing Java application performance still left something to be desired. With J2SE 5.0, you had the ability to use DTrace to sample Java stacks, which although useful, was limited. The DVM provider for DTrace allowed more observability, but at a price—the application had to be restarted and the non-enabled probe-effect was still higher than developers would have liked.

With the release of Java SE 6, the love between Java and DTrace has become much stronger. DTrace probes are first-class citizens in the eyes of Java when run on a Solaris 10 system (regardless of SPARC/x86/x64 architecture). The DTrace probes in Java have zero disabled probe-effect; they can be enabled/disabled dynamically, and they have a much lower enabled probe-effect than the DVM provider (although an enabled probe-effect exists, but more on that later). This means that from a single tool—DTrace—you can observe your Java code in action, the JVM itself, JNI code, and the kernel to identify and correct performance problems. With this true systemic observability, it is very difficult for performance problems to hide.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date