JFluid: Profiling Technology Based on Dynamic Bytecode Instrumentation
Instrumentation-based profiling has many advantages and one serious disadvantage: usually high performance overhead. This overhead could be substantially reduced if only a small portion of the target application (for example, one that has previously been identified as a bottleneck, or just one for which a developer is responsible) is instrumented, while the rest of the application code runs at full speed. The value of such a profiling technology would increase further if the code could be instrumented and de-instrumented as many times as needed at run time.
JFluid (http://research.sun.com/projects/jfluid) is an experimental profiling system, which includes a modified Java HotSpot VM and a GUI tool, and addresses both of the above issues. It allows a user to attach the tool to the VM started without any special preparation, dynamically instrument and de-instrument one or more application methods, and obtain profiling data on-line. Our tool supports instrumentation of a group of methods defined as an arbitrary "root" method plus all methods that it calls (a call subgraph) for CPU and object allocation profiling. It appears that static determination of all methods in a call subgraph is difficult in presence of virtual methods, bug fortunately, with dynamic code hotswapping available, two schemes of dynamic call subgraph revelation and instrumentation can be suggested. The technology for dynamic, selective code instrumentation appears to be very useful in practice for profiling large applications with many threads, for which conventional "total" instrumentation often does not scale.
Misha Dmitriev received his Diploma in Computer Science and PhD in Computer Science from the University of Cambridge and the University of Glasgow, UK, respectively. The projects in which he was involved through his PhD and the subsequent career at Sun Labs, California were: PJama (a persistent platform, effectively a "transparent" object database, for Java), HotSwap (runtime evolution of Java applications), and Javamake (a dependency, or smart recompilation, tool for Java). He is presently a lead for the JFluid project, that investigates how runtime code hotswapping techniques can be used to build smart, unobtrusive mechanisms for runtime introspection of Java applications.