Chapter 1. Overview

Mike's Java Profiler is a performance profiler for Java programs. It collects statistics about accumulated time used by each method in the profiled program and presents the collected data in a GUI. The presented data can be used to locate execution bottlenecks within the profiled program. The data is presented in way that allows the user to first view data at a low level of detail and then to drill down to higher levels of detail. This facilitates more efficient bottleneck identification than if the data was presented as a 1-dimensional list like in some similar applications.

The profiler consists of 3 parts: a JVMPI profiler agent, a GUI, and a small JNI API. Each part is described below.

The JVMPI profiler agent is written in C++ and consists of a dynamic library. It is loaded by the Java Virtual Machine at runtime, collects data on the running application, and writes the collected data to a file.

The GUI is written in 100% Java and uses Swing. It presents the collected data in two different views: as a call graph where each node is uniquely associated with one method and as a call tree where each node is uniquely associated with one stack frame. For each node in both views, the GUI presents statistics on the node, its parents, and its children. This allows the user to see how the time spent in a method was distributed among its children. Using this mechanism the user can drill down into the call graph and look at finer detail.

The small JNI API allows the profiler to control from within the profiled program itself. Using the API the user can turn data collection on and off. This allows the user to control the amount of data collected and the impact of the profiler's overhead. For example, if your application is running inside an application server such as OpenEJB or WebSphere, you can use the JNI API to skip over the lengthy server boot-up stage and start profiling only when your code begins execution. This can greatly reduce the size of the resultant data set and make it easier to identify your own bottlenecks.

Though the GUI is 100% Java and therefore will run out-of-the-box on many platforms, the data collection part is written in C++ and will compile on only small set of platforms. This is necessitated by the design of JVMPI and not the profiler itself. See the release notes for a list of tested platforms.