Analysis and visualization of logs and assembly code from the JVM JIT (Just-In-Time) compiler, built as a plugin for IntelliJ IDEA. It is based on the foundations of JitWatch by Chris Newland and jitwatch-intellij by Dmitry Jemerov.
- Compiled packages/classes/methods: Lists compiled methods organized in a package-class tree, shows compilation times, optimization levels (L1–L4), and compiler type.
- Analysis: Provides a range of tools to visualize and analyze JIT compilation data, including activity timelines, memory usage, and performance metrics.
- Code Integration: Displays bytecode and assembly code side-by-side with the original Java source, with syntax highlighting.
To analyze JIT compilation data using the plugin, you need to have a compilation log. If one does not already exist, you can easily create it by enabling the "Log compilation" option in your run configuration settings. When enabled, this will generate a HotSpot log in a temporary directory.
Alternatively, you can add the logging options to the VM options of your run configuration, and then load the log file manually. To enable logging, you need the following options:
-XX:+UnlockDiagnosticVMOptions
-XX:+TraceClassLoading
-XX:+LogCompilation
-XX:+PrintAssembly
-XX:LogFile=my_compilation.log
After creating the compilation log, simply open it in the plugin. JITWatch4i will automatically parse the log and present the resulting analysis in tabs in toolwindow.
Lists compiled methods organized in a class tree, shows compilation times, optimization levels (L1–L4), and compiler type.
Tab "Tops" Displays methods ranked by various metrics, including the largest generated code, longest compilation times, most frequent deoptimizations, and failed inlining attempts.
Shows compilers' thread activity over time, with compilations represented by rectangles sized by generated code. Compilations are selectable.
Shows a timeline of compilations categorized by optimization levels (L1–L4), illustrating how compilation activity changes over time. Levels L1+L2+L3 are compiled by C1, L4 is compiled by C2.
Tab "Histo" provides histograms to analyze the distribution of compiled code sizes, compilation durations, and sizes of inlined methods.
Tracks the allocated memory in the Code Cache over time.
Tab "CC Layout" displays a detailed layout of the Code Cache memory.
Tab "Comp Chain" shows the compilation structure of methods, including inlined methods and external calls.
Identifies performance-critical areas such as:
- Hot Methods: shows info about methods that were not inlined, with reasons for inlining failures.
- Branch Prediction: identifies unpredictable branches that impact performance.
The editor provides seamless integration with the plugin's features. The Jitwatch tool window on the right edge displays a synchronized view of the bytecode and assembly code for the currently selected method. As you navigate through the source code in the editor, the bytecode and assembly views automatically update to reflect the corresponding position.
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "jitwatch4i" > Install
This plugin is based on:
- JitWatch by Chris Newland.
- jitwatch-intellij by Dmitry Jemerov