Product SiteDocumentation Site

20.9. OProfile Support for Java

OProfile allows you to profile dynamically compiled code (also known as "just-in-time" or JIT code) of the Java Virtual Machine (JVM). OProfile in Fedora 24 includes built-in support for the JVM Tools Interface (JVMTI) agent library, which supports Java 1.5 and higher.

20.9.1. Profiling Java Code

To profile JIT code from the Java Virtual Machine with the JVMTI agent, add the following to the JVM startup parameters:
Where jvmti_oprofile is a path to the OProfile agent. For 64-bit JVM, the path looks as follows:
Currently, you can add one command-line option: --debug, which enables debugging mode.

Install the oprofile-jit package

The oprofile-jit package must be installed on the system in order to profile JIT code with OProfile. With this package, you gain the capability to show method-level information.
Depending on the JVM that you are using, you may have to install the debuginfo package for the JVM. For OpenJDK, this package is required, there is no debuginfo package for Oracle JDK. To keep the debug information packages synchronized with their respective non-debug packages, you also need to install the yum-plugin-auto-update-debug-info plug-in. This plug-in searches the debug information repository for corresponding updates.
After successful setup, you can apply the standard profiling and analyzing tools described in previous sections
To learn more about Java support in OProfile, see the OProfile Manual, which is linked from Section 20.12, “Additional Resources”.