Skip to content

JITWatch4i is an IntelliJ IDEA plugin for analyzing and visualizing logs from the HotSpot JIT (Just-In-Time) compiler

License

Notifications You must be signed in to change notification settings

JetBrains/jitwatch4i

Repository files navigation

icon

JITWatch4i

Contributions welcome Version

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.

Features

  • 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.

Overview

Creating a Compilation Log

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

Opening a 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.

Toolwindow

Main

Lists compiled methods organized in a class tree, shows compilation times, optimization levels (L1–L4), and compiler type. MainPanel

Top lists

Tab "Tops" Displays methods ranked by various metrics, including the largest generated code, longest compilation times, most frequent deoptimizations, and failed inlining attempts. MainPanel

Compilers Activity

Shows compilers' thread activity over time, with compilations represented by rectangles sized by generated code. Compilations are selectable. MainPanel

Time Line

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. MainPanel

Histograms

Tab "Histo" provides histograms to analyze the distribution of compiled code sizes, compilation durations, and sizes of inlined methods. MainPanel

Free Code Cache

Tracks the allocated memory in the Code Cache over time. MainPanel

Code Cache Layout

Tab "CC Layout" displays a detailed layout of the Code Cache memory. MainPanel

Compilation Chain

Tab "Comp Chain" shows the compilation structure of methods, including inlined methods and external calls. MainPanel

Code Suggest

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. MainPanel

Editor

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.

Installation

  • Using the IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "jitwatch4i" > Install

Credits

This plugin is based on:

About

JITWatch4i is an IntelliJ IDEA plugin for analyzing and visualizing logs from the HotSpot JIT (Just-In-Time) compiler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published