IntelliJ IDEA 2024.2 Help

CPU and memory live charts

IntelliJ IDEA provides a way to monitor live performance statistics for a running process through CPU and Memory Live Charts.

As opposed to viewing static figures, live data may help you to visualize resource consumption, identify resource-related bottlenecks, and understand how certain events affect the program performance.

For example, in the picture below, we can see what a memory leak looks like in the Heap Memory chart. Sometimes it is enough to figure out the cause, and when it is not enough, it can give a clue for further investigation.

Memory leak on CPU and Memory Live Charts

CPU and Memory Live Charts are automatically shown for all programs that you run from IntelliJ IDEA:

CPU and Memory Live Charts in the Run tool window

Open CPU and Memory Live Charts for an arbitrary Java process

In case the target process was launched outside IntelliJ IDEA, you can open CPU and Memory Live Charts from the Profiler home page. This dedicated view will also show thread usage data.

  1. In the main menu, go to View | Tool Windows | Profiler.

  2. Right-click the necessary process in the Profiler tool window and select CPU and Memory Live Charts.

    Accessing live charts for a running process

    A new tab opens in which you can see the resources the selected process consumes.

    CPU and Memory live charts

The following metrics are available:

  • CPU – CPU load for the given process. Each process has its own figure.

  • Heap memory – the current usage of heap memory and maximum heap size. The heap size increases when new objects of reference types are allocated and decreases when they are garbage-collected.

  • Threads – the overall number of threads (yellow) and daemon threads (red). The number after the slash is the peak number of threads since the process has started.

  • Non-heap memory – this type of memory is used by the JVM to store class metadata, method data, and other JVM internals. The first value is the current memory value, and the second is the maximum value since the charts have started.

Get a metric for a specific instant

  • Hover over the point on the chart. IntelliJ IDEA will show the corresponding metric and timestamp.

    The numeric value appears on hovering over the chart

Adjust the timeframe

  • Click The Presentation Settings button and select the time period over which you want to see the collected data. Alternatively, you can select Show all data – this will display the entire recording.

    The options in the Presentation Settings menu allowing you to change the inspected timeframe

Call garbage collection

  • If you need to test how garbage collection works under specific conditions, you can request it from CPU and Memory Live Charts. For that, click the Perform GC button.

    Perform GC button
Last modified: 11 October 2024