Skip to content

Profiling


Profiling continuously samples and collects data on an application's runtime status across CPU, memory, I/O, and other aspects, automatically capturing its performance profiling data. The collected data is visualized in real-time through flame graphs, clearly displaying the call stack relationships and resource consumption ratios between every method, class, and thread. This helps developers identify hot functions and efficiency bottlenecks, providing data support for code-level performance optimization.

In the Profiling explorer, you can:

  • Analyze runtime dynamic performance data for applications in different languages such as Java, Python, Go, and C/C++ based on flame graphs, intuitively locating performance issues caused by inefficient algorithms, memory leaks, or improper I/O operations.

  • By associating with traces, obtain the code execution segments corresponding to specific business requests (spans), achieving end-to-end performance tracking from business interfaces to specific methods, and precisely identifying optimization directions.

Prerequisites

  1. Install DataKit.
  2. Enable the Profiling collector.

After Profiling data is reported, you can query and analyze it through the explorer, supporting operations such as search filtering, quick filtering, column customization, and data export.

Note

Profiling data is retained for 7 days by default.

Profiling Details Page

Performance

On the details page, you automatically enter the "Performance" tab, which includes attribute tags, performance flame graphs, and runtime information.

If the current Profile file size exceeds 20MB, online parsing is temporarily unsupported. You can download the file locally and use professional analysis tools to view it. For example:

Flame Graph

The core of Profiling is using flame graphs for code-level performance analysis. Flame graphs intuitively display the execution time or resource consumption distribution of various methods in the call stack. The system also provides aggregated data analysis views based on multiple dimensions such as methods, libraries, and threads, directly listing the hot methods with the highest execution proportion to help quickly focus on core performance issues.

The analysis capability supports multiple programming languages, and the observable indicator dimensions vary for different languages. For example:

Category Description
CPU Time The running time of each method on the CPU
Wall Time The total time spent by each method, including time running on the CPU, time waiting for I/O, and time spent on anything else that happens during method execution
Heap Live Size The amount of heap memory still in use
Allocated Memory The amount of heap memory allocated by each method, including allocations that were later freed
Allocations The number of heap allocations performed by each method, including allocations that were later freed
Thrown Exceptions The number of exceptions thrown by each method
Lock Wait Time The time each function spends waiting for a lock
Locked Time The time each function holds a lock
Lock Acquires The number of times each method acquires a lock
Lock Releases The number of times each method releases a lock

Category Description
CPU Time The running time of each method on the CPU, including the service's Java bytecode and runtime operation time, excluding time spent on native code calls made through the JVM
Wall Time in Native Code The number of samples for native code. Sampling can occur when code is running on the CPU, waiting for I/O, and any other situation during method execution. This does not include Java bytecode calls involved in running application code
Allocations The number of heap allocations performed by each method, including allocations that were later freed
Allocated Memory The amount of heap memory allocated by each method, including allocations that were later freed
Heap Live Objects The number of live objects allocated to each method
Thrown Exceptions The number of exceptions thrown by each method
Lock Wait Time The time each method spends waiting for a lock
Lock Acquires The number of times each method acquires a lock
File I/O Time The time each method spends on file reading and writing
File I/O Written The amount of data written to files by each method
File I/O Read The amount of data read from files by each method
Socket I/O Read Time The time each method spends reading from sockets
Socket I/O Write Time The time each method spends writing to sockets
Socket I/O Read The amount of data read from sockets by each method
Socket I/O Written The amount of data written to sockets by each method
Synchronization The time each method spends on synchronization

Quick Operations

  • Search: In the Type selection box, enter a method name keyword for fuzzy search. Select directly from the matching results to quickly locate and focus on viewing a specific method.
  • Copy: Under Dimensions, hover to copy and view method details.
  • Click to select: The Dimensions list displays all methods by default. Click any method, and the flame graph will focus on displaying the call path of that method. Multiple selections are supported to compare the execution of multiple methods. Click the selected method again to deselect it and restore the panoramic view.

Runtime Information

On the Runtime Information tab, you can view associated fields and tag attributes of the corresponding programming language runtime, including process parameters, environment variables, and system tags. You can add any tag as a filter condition to the explorer list panel to quickly filter related data. You can also directly copy the tag content for associated queries in logs or traces.

Trace Association with Profiling

When both APM trace collection and Profiling collection are enabled for an application, the system supports associating performance profiling data at the trace level. On the Trace Details Page in APM, select any span on the flame graph to view the list of associated code method calls and their Wall Time consumption ratio during the execution period of that business request.

This enables穿透式 analysis from a slow business request directly to the specific time-consuming methods, and supports one-click navigation to the full Profiling details page to view more comprehensive performance profiling data (such as CPU and memory dimensions) during that time period for in-depth root cause investigation.

Click View Profiling Details to navigate to the corresponding Profiling details page and view specific performance data.