The Java DTrace Toolkit
DTrace is a dynamic tracing framework, initially developed by Sun for the Solaris 10 OS. Since some early beta version of the Java 1.6 JDK, the JVM (at least on Solaris) has incorporated a number of DTrace probes that allow DTrace to extract data from a program running within the JVM at runtime.
I initially used DTrace for Java to study the interaction of the OS with the JVM on the I/O front. I then understood that my scripts might be useful to a number of people doing low level performance analysis so I spent some time to make them a bit more generic and easy to use.
You can download the Java DTrace Toolkit from here
The JDT has been presented in the following short paper:
G. Gousios and D. Spinellis, “Java Performance Evaluation Using External Instrumentation,” in Proceedings of the 12th Pan-Hellenic Conference on Informatics, 2008, pp. 173–177.
###The scripts
Script | Function |
jprofiler | Reports the methods and classes that consume most execution time. Can aggregate results by package name. |
jmemstats | Report object allocation statistics. Can aggregate results by package name and filter results by specific package names. |
jlockstat | Reports methods initiating locking opera- tions in native code. |
jiosnoop | File management statistics: which classes cause I/O traffic? |
jcallgraph | Display a Java function call graph from Java to the OS kernel. |
jgcsnoop | Reports garbage collection statistics: frequency, duration. |
###Output examples
####jmemstats
####jlockstat
####jiosnoop